Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests for 3.10rc1 and up #872

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions typing_extensions/src_py3/test_typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
TYPING_3_5_3 = TYPING_LATEST or sys.version_info[:3] >= (3, 5, 3)
TYPING_3_6_1 = TYPING_LATEST or sys.version_info[:3] >= (3, 6, 1)
TYPING_3_10_0 = TYPING_LATEST or sys.version_info[:3] >= (3, 10, 0)
TYPING_3_11_0 = TYPING_LATEST or sys.version_info[:3] >= (3, 11, 0)

# For typing versions where issubclass(...) and
# isinstance(...) checks are forbidden.
Expand Down Expand Up @@ -466,6 +467,10 @@ class GetTypeHintTests(BaseTestCase):
@skipUnless(PY36, 'Python 3.6 required')
def test_get_type_hints_modules(self):
ann_module_type_hints = {1: 2, 'f': Tuple[int, int], 'x': int, 'y': str}
if (TYPING_3_11_0
or (TYPING_3_10_0 and sys.version_info.releaselevel in {'candidate', 'final'})):
# More tests were added in 3.10rc1.
ann_module_type_hints['u'] = int | float
self.assertEqual(gth(ann_module), ann_module_type_hints)
self.assertEqual(gth(ann_module2), {})
self.assertEqual(gth(ann_module3), {})
Expand Down