Skip to content

Commit 137c916

Browse files
committed
Fix existing tests
1 parent abd9aed commit 137c916

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Lib/test/test_typing.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,10 @@ def func1(*args: *Ts): pass
16051605
self.assertEqual(gth(func1), {'args': Unpack[Ts]})
16061606

16071607
def func2(*args: *tuple[int, str]): pass
1608-
self.assertEqual(gth(func2), {'args': Unpack[tuple[int, str]]})
1608+
hint = gth(func2)['args']
1609+
self.assertIsInstance(hint, types.GenericAlias)
1610+
self.assertEqual(hint.__args__[0], int)
1611+
self.assertIs(hint.__unpacked__, True)
16091612

16101613
class CustomVariadic(Generic[*Ts]): pass
16111614

@@ -1620,7 +1623,10 @@ def func1(*args: '*Ts'): pass
16201623
{'args': Unpack[Ts]})
16211624

16221625
def func2(*args: '*tuple[int, str]'): pass
1623-
self.assertEqual(gth(func2), {'args': Unpack[tuple[int, str]]})
1626+
hint = gth(func2)['args']
1627+
self.assertIsInstance(hint, types.GenericAlias)
1628+
self.assertEqual(hint.__args__[0], int)
1629+
self.assertIs(hint.__unpacked__, True)
16241630

16251631
class CustomVariadic(Generic[*Ts]): pass
16261632

0 commit comments

Comments
 (0)