We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b43ef07 commit c02f508Copy full SHA for c02f508
pyflakes/test/test_imports.py
@@ -1069,6 +1069,18 @@ def f() -> "b":
1069
pass
1070
''')
1071
1072
+ def test_uses_typing_imports_for_annotations_in_comments(self):
1073
+ """Uses imports within 'if TYPE_CHECKING' checking annotations."""
1074
+ if self.withDoctest:
1075
+ return
1076
+ self.flakes('''
1077
+ from typing import TYPE_CHECKING
1078
+ if TYPE_CHECKING:
1079
+ from a import b
1080
+ def f(): # type: () -> b
1081
+ pass
1082
+ ''')
1083
+
1084
1085
class TestSpecialAll(TestCase):
1086
"""
0 commit comments