summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2016-11-09 21:19:01 (GMT)
committerGuido van Rossum <guido@python.org>2016-11-09 21:19:01 (GMT)
commit45b09cacdea96bf996a9b1dc0bd87f9651ab9fb8 (patch)
tree53dba9453a27575057178e56bf576a367a4f30e8 /Lib
parenta50c79f36fca01cb73c8eeee7219d7e44d6fa64c (diff)
parent83be424700776962b93979e9c5a81ebe88a41730 (diff)
downloadcpython-45b09cacdea96bf996a9b1dc0bd87f9651ab9fb8.zip
cpython-45b09cacdea96bf996a9b1dc0bd87f9651ab9fb8.tar.gz
cpython-45b09cacdea96bf996a9b1dc0bd87f9651ab9fb8.tar.bz2
Issue #28649: fix-typing-test-v2.diff (3.6->3.7)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_typing.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index ae9de61..0582845 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -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, ...])