diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-08-30 10:34:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 10:34:55 +0300 |
commit | 75177358a62afeabd1d3aa0e9f395c2b9d4495ca (patch) | |
tree | f9831706cdbc25e690683119210baa3d102956f1 /Lib/test/test_typing.py | |
parent | d21d2f0793ce32d72759d5cfc11622d13e3e6b81 (diff) | |
download | cpython-75177358a62afeabd1d3aa0e9f395c2b9d4495ca.tar.gz cpython-75177358a62afeabd1d3aa0e9f395c2b9d4495ca.zip |
gh-96385: Correctly raise error on `[*T, *V]` substitution (GH-96386)
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index ca7bd8e083c..7eea01909ec 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -596,6 +596,7 @@ class GenericAliasSubstitutionTests(BaseTestCase): def test_one_parameter(self): T = TypeVar('T') Ts = TypeVarTuple('Ts') + Ts2 = TypeVarTuple('Ts2') class C(Generic[T]): pass @@ -621,6 +622,8 @@ class GenericAliasSubstitutionTests(BaseTestCase): # Should definitely raise TypeError: list only takes one argument. ('list[T, *tuple_type[int, ...]]', '[int]', 'list[int, *tuple_type[int, ...]]'), ('List[T, *tuple_type[int, ...]]', '[int]', 'TypeError'), + # Should raise, because more than one `TypeVarTuple` is not supported. + ('generic[*Ts, *Ts2]', '[int]', 'TypeError'), ] for alias_template, args_template, expected_template in tests: |