]> granicus.if.org Git - python/commitdiff
Issue #28649: fix-typing-test-v2.diff
authorGuido van Rossum <guido@python.org>
Wed, 9 Nov 2016 21:18:59 +0000 (13:18 -0800)
committerGuido van Rossum <guido@python.org>
Wed, 9 Nov 2016 21:18:59 +0000 (13:18 -0800)
Lib/test/test_typing.py

index ae9de612739cc85a1731642a456f8ac16c00d007..05828459c6b9fbc8c1df7b6d7f8042391b096b45 100644 (file)
@@ -743,10 +743,11 @@ class GenericTests(BaseTestCase):
         self.assertEqual(repr(Callable[[], List[T]][int]).replace('typing.', ''),
                          'Callable[[], List[int]]')
 
-    def test_generic_forvard_ref(self):
-        def foobar(x: List[List['T']]): ...
+    def test_generic_forward_ref(self):
+        def foobar(x: List[List['CC']]): ...
+        class CC: ...
+        self.assertEqual(get_type_hints(foobar, globals(), locals()), {'x': List[List[CC]]})
         T = TypeVar('T')
-        self.assertEqual(get_type_hints(foobar, globals(), locals()), {'x': List[List[T]]})
         def barfoo(x: Tuple[T, ...]): ...
         self.assertIs(get_type_hints(barfoo, globals(), locals())['x'], Tuple[T, ...])