Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58de2e9

Browse files
Fix tests for 3.10rc1 and up (#872)
1 parent af13555 commit 58de2e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

typing_extensions/src_py3/test_typing_extensions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
TYPING_3_5_3 = TYPING_LATEST or sys.version_info[:3] >= (3, 5, 3)
5454
TYPING_3_6_1 = TYPING_LATEST or sys.version_info[:3] >= (3, 6, 1)
5555
TYPING_3_10_0 = TYPING_LATEST or sys.version_info[:3] >= (3, 10, 0)
56+
TYPING_3_11_0 = TYPING_LATEST or sys.version_info[:3] >= (3, 11, 0)
5657

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

0 commit comments

Comments
 (0)