From 0ae799a2fdca567ea60822838d9809182403420f Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Tue, 22 Sep 2026 16:33:04 -0400 Subject: [PATCH] improve coverage for __all__ handling --- pyflakes/test/test_imports.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pyflakes/test/test_imports.py b/pyflakes/test/test_imports.py index eb96d6a7..bfad5812 100644 --- a/pyflakes/test/test_imports.py +++ b/pyflakes/test/test_imports.py @@ -1095,6 +1095,25 @@ def test_tuple_concatenation_assignment(self): __all__ = ('a',) + ('b',) + ('c',) ''', m.UndefinedExport, m.UndefinedExport, m.UndefinedExport, m.UnusedImport) + def test_ignores_concatenated_assignment_with_var(self): + self.flakes(''' + x = ['this_is_not_visible'] + __all__ = x + ['a'] + ''', m.UndefinedExport) + + def test_ignores_multi_concatenated_assignment_with_var(self): + self.flakes(''' + x = ['this_is_not_visible'] + __all__ = ['this_is_also_not_visible'] + x + ['b'] + ''', m.UndefinedExport) + + def test_ignores_all_with_unknown_value(self): + self.flakes(''' + import export + x = ('export',) + __all__ = x + ''', m.UnusedImport) + def test_all_with_attributes(self): self.flakes(''' from foo import bar