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.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pyflakes/test/test_type_annotations.py b/pyflakes/test/test_type_annotations.py
index 2f27b06..f0fd3b9 100644
--- a/pyflakes/test/test_type_annotations.py
+++ b/pyflakes/test/test_type_annotations.py
@@ -594,6 +594,20 @@ class TestTypeAnnotations(TestCase):
return None
""")
+ def test_forward_annotations_for_classes_in_scope(self):
+ # see #749
+ self.flakes("""
+ from typing import Optional
+
+ def f():
+ class C:
+ a: "D"
+ b: Optional["D"]
+ c: "Optional[D]"
+
+ class D: pass
+ """)
+
def test_idomiatic_typing_guards(self):
# typing.TYPE_CHECKING: python3.5.3+
self.flakes("""