summaryrefslogtreecommitdiff
path: root/pyflakes/test/test_type_annotations.py
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2022-05-30 12:25:29 -0400
committerGitHub <noreply@github.com>2022-05-30 12:25:29 -0400
commit2a61f3c0a1dddb00453c66d1fa9f45d7b5b7897d (patch)
tree6ae8996753f1c2660d0119cb4f9ef903cae01762 /pyflakes/test/test_type_annotations.py
parente02336c3d47c621feed730f5bdaa792babca75be (diff)
downloadpyflakes-2a61f3c0a1dddb00453c66d1fa9f45d7b5b7897d.tar.gz
add tests for python3.11-specific syntax (#694)
Diffstat (limited to 'pyflakes/test/test_type_annotations.py')
-rw-r--r--pyflakes/test/test_type_annotations.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pyflakes/test/test_type_annotations.py b/pyflakes/test/test_type_annotations.py
index 3b6d5e7..1caecb4 100644
--- a/pyflakes/test/test_type_annotations.py
+++ b/pyflakes/test/test_type_annotations.py
@@ -801,3 +801,18 @@ class TestTypeAnnotations(TestCase):
class Y(NamedTuple):
y: NamedTuple("v", [("vv", int)])
""")
+
+ @skipIf(version_info < (3, 11), 'new in Python 3.11')
+ def test_variadic_generics(self):
+ self.flakes("""
+ from typing import Generic
+ from typing import TypeVarTuple
+
+ Ts = TypeVarTuple('Ts')
+
+ class Shape(Generic[*Ts]): pass
+
+ def f(*args: *Ts) -> None: ...
+
+ def g(x: Shape[*Ts]) -> Shape[*Ts]: ...
+ """)