Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pyflakes/test/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +1104 to +1108

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is arguably a bug -- it should probably handle each list in here since it "sorta" knows statically those values

but for now I'm just adding test coverage for the current code


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
Expand Down
Loading