Skip to content

Running test_typing file directly fails #122835

@Eclips4

Description

@Eclips4

Bug report

Bug description:

eclips4@nixos ~/p/p/cpython (main)> ./python Lib/test/test_typing.py
...................................................................................................................................................................................................................................................................s.........................................................................................................................................................................................................................................................................................................................................F............................................................................................
======================================================================
FAIL: test_annotations (__main__.TypedDictTests.test_annotations)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/eclips4/programming/programming-languages/cpython/Lib/test/test_typing.py", line 8832, in test_annotations
    self.assertEqual(Y.__annotations__, {'a': type(None), 'b': fwdref})
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'a': <class 'NoneType'>, 'b': ForwardRef('int', module='__main__')} != {'a': <class 'NoneType'>, 'b': ForwardRef('int', module='test.test_typing')}
- {'a': <class 'NoneType'>, 'b': ForwardRef('int', module='__main__')}
?                                                           ^^^  ^^

+ {'a': <class 'NoneType'>, 'b': ForwardRef('int', module='test.test_typing')}
?                                                          +++++++++ ^^^  ^


----------------------------------------------------------------------
Ran 682 tests in 0.506s

FAILED (failures=1, skipped=1)

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-typingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions