summaryrefslogtreecommitdiff
path: root/pyflakes/test/test_type_annotations.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyflakes/test/test_type_annotations.py')
-rw-r--r--pyflakes/test/test_type_annotations.py24
1 files changed, 1 insertions, 23 deletions
diff --git a/pyflakes/test/test_type_annotations.py b/pyflakes/test/test_type_annotations.py
index 1caecb4..3775cd3 100644
--- a/pyflakes/test/test_type_annotations.py
+++ b/pyflakes/test/test_type_annotations.py
@@ -68,7 +68,6 @@ class TestTypeAnnotations(TestCase):
return s
""")
- @skipIf(version_info < (3, 5), 'new in Python 3.5')
def test_typingOverloadAsync(self):
"""Allow intentional redefinitions via @typing.overload (async)"""
self.flakes("""
@@ -152,7 +151,6 @@ class TestTypeAnnotations(TestCase):
pass
""", m.RedefinedWhileUnused)
- @skipIf(version_info < (3, 6), 'new in Python 3.6')
def test_variable_annotations(self):
self.flakes('''
name: str
@@ -300,7 +298,6 @@ class TestTypeAnnotations(TestCase):
a: 'a: "A"'
''', m.ForwardAnnotationSyntaxError)
- @skipIf(version_info < (3, 6), 'new in Python 3.6')
def test_TypeAlias_annotations(self):
self.flakes("""
from typing_extensions import TypeAlias
@@ -340,7 +337,6 @@ class TestTypeAnnotations(TestCase):
bar: TypeAlias
""", m.UnusedImport)
- @skipIf(version_info < (3, 6), 'new in Python 3.6')
def test_annotating_an_import(self):
self.flakes('''
from a import b, c
@@ -348,7 +344,6 @@ class TestTypeAnnotations(TestCase):
print(b)
''')
- @skipIf(version_info < (3, 6), 'new in Python 3.6')
def test_unused_annotation(self):
# Unused annotations are fine in module and class scope
self.flakes('''
@@ -368,7 +363,6 @@ class TestTypeAnnotations(TestCase):
x = 3
''', m.UnusedVariable)
- @skipIf(version_info < (3, 5), 'new in Python 3.5')
def test_annotated_async_def(self):
self.flakes('''
class c: pass
@@ -400,7 +394,6 @@ class TestTypeAnnotations(TestCase):
def g(t: 'T'): pass
''')
- @skipIf(version_info < (3, 6), 'new in Python 3.6')
def test_type_annotation_clobbers_all(self):
self.flakes('''\
from typing import TYPE_CHECKING, List
@@ -518,13 +511,10 @@ class TestTypeAnnotations(TestCase):
""", m.UndefinedName)
def test_typeIgnoreBogusUnicode(self):
- error = (m.CommentAnnotationSyntaxError if version_info < (3,)
- else m.UndefinedName)
self.flakes("""
x = 2 # type: ignore\xc3
- """, error)
+ """, m.UndefinedName)
- @skipIf(version_info < (3,), 'new in Python 3')
def test_return_annotation_is_class_scope_variable(self):
self.flakes("""
from typing import TypeVar
@@ -535,7 +525,6 @@ class TestTypeAnnotations(TestCase):
return x
""")
- @skipIf(version_info < (3,), 'new in Python 3')
def test_return_annotation_is_function_body_variable(self):
self.flakes("""
class Test:
@@ -552,7 +541,6 @@ class TestTypeAnnotations(TestCase):
def f(c: C, /): ...
""")
- @skipIf(version_info < (3,), 'new in Python 3')
def test_partially_quoted_type_annotation(self):
self.flakes("""
from queue import Queue
@@ -617,7 +605,6 @@ class TestTypeAnnotations(TestCase):
S = TypeVar('S', int, bound='List[int]')
""")
- @skipIf(version_info < (3,), 'new in Python 3')
def test_literal_type_typing(self):
self.flakes("""
from typing import Literal
@@ -626,7 +613,6 @@ class TestTypeAnnotations(TestCase):
return None
""")
- @skipIf(version_info < (3,), 'new in Python 3')
def test_literal_type_typing_extensions(self):
self.flakes("""
from typing_extensions import Literal
@@ -635,7 +621,6 @@ class TestTypeAnnotations(TestCase):
return None
""")
- @skipIf(version_info < (3,), 'new in Python 3')
def test_annotated_type_typing_missing_forward_type(self):
self.flakes("""
from typing import Annotated
@@ -644,7 +629,6 @@ class TestTypeAnnotations(TestCase):
return None
""", m.UndefinedName)
- @skipIf(version_info < (3,), 'new in Python 3')
def test_annotated_type_typing_missing_forward_type_multiple_args(self):
self.flakes("""
from typing import Annotated
@@ -653,7 +637,6 @@ class TestTypeAnnotations(TestCase):
return None
""", m.UndefinedName)
- @skipIf(version_info < (3,), 'new in Python 3')
def test_annotated_type_typing_with_string_args(self):
self.flakes("""
from typing import Annotated
@@ -662,7 +645,6 @@ class TestTypeAnnotations(TestCase):
return None
""")
- @skipIf(version_info < (3,), 'new in Python 3')
def test_annotated_type_typing_with_string_args_in_union(self):
self.flakes("""
from typing import Annotated, Union
@@ -671,7 +653,6 @@ class TestTypeAnnotations(TestCase):
return None
""", m.UndefinedName)
- @skipIf(version_info < (3,), 'new in Python 3')
def test_literal_type_some_other_module(self):
"""err on the side of false-negatives for types named Literal"""
self.flakes("""
@@ -684,7 +665,6 @@ class TestTypeAnnotations(TestCase):
return None
""")
- @skipIf(version_info < (3,), 'new in Python 3')
def test_literal_union_type_typing(self):
self.flakes("""
from typing import Literal
@@ -693,7 +673,6 @@ class TestTypeAnnotations(TestCase):
return None
""")
- @skipIf(version_info < (3,), 'new in Python 3')
def test_deferred_twice_annotation(self):
self.flakes("""
from queue import Queue
@@ -791,7 +770,6 @@ class TestTypeAnnotations(TestCase):
cast(A["E"], [])
""")
- @skipIf(version_info < (3, 6), 'new in Python 3.6')
def test_namedtypes_classes(self):
self.flakes("""
from typing import TypedDict, NamedTuple