summaryrefslogtreecommitdiff
path: root/pyflakes/test/test_imports.py
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2022-02-12 09:52:33 -0500
committerGitHub <noreply@github.com>2022-02-12 06:52:33 -0800
commit1fae3dea5108a006d35da9e9ab785ca1ed1bc998 (patch)
treebcfc0c46ae69366dbd8f9a59073209c928808f48 /pyflakes/test/test_imports.py
parentdbb18432165bdc567e015511b3f3284f0f14cf05 (diff)
downloadpyflakes-1fae3dea5108a006d35da9e9ab785ca1ed1bc998.tar.gz
ignore `__all__` when not directly assigned (#675)
Diffstat (limited to 'pyflakes/test/test_imports.py')
-rw-r--r--pyflakes/test/test_imports.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pyflakes/test/test_imports.py b/pyflakes/test/test_imports.py
index d5be269..07504d9 100644
--- a/pyflakes/test/test_imports.py
+++ b/pyflakes/test/test_imports.py
@@ -1057,6 +1057,12 @@ class TestSpecialAll(TestCase):
__all__ = ["bar"]
''', m.UnusedImport)
+ def test_ignored_when_not_directly_assigned(self):
+ self.flakes('''
+ import bar
+ (__all__,) = ("foo",)
+ ''', m.UnusedImport)
+
def test_warningSuppressed(self):
"""
If a name is imported and unused but is named in C{__all__}, no warning