diff options
| author | John Vandenberg <jayvdb@gmail.com> | 2016-05-06 03:16:10 +0700 |
|---|---|---|
| committer | Ian Cordasco <sigmavirus24@users.noreply.github.com> | 2016-05-05 15:16:10 -0500 |
| commit | 45c28a31d3f4c402056433da2a7eb29f565e4344 (patch) | |
| tree | 82b45b64a377c2c71ad3fc5a0f86c1f427a95fde /pyflakes/test | |
| parent | 4361b6d0733837e4d0e402c41cb55961bd43a5d7 (diff) | |
| download | pyflakes-45c28a31d3f4c402056433da2a7eb29f565e4344.tar.gz | |
Suppress RedefinedWhileUnused for submodule import (#62)
Fixes lp:1578051
aec68a7 added module names to error messages, which included
a new class SubmoduleImportation to handle the special case
of submodule imports. It correctly handled the case of
a submodule import occurring after the root module was imported,
but didnt handle the opposite case of the submodule import
occurring before the root module was imported.
Diffstat (limited to 'pyflakes/test')
| -rw-r--r-- | pyflakes/test/test_imports.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pyflakes/test/test_imports.py b/pyflakes/test/test_imports.py index 41a0e07..9cbd4d7 100644 --- a/pyflakes/test/test_imports.py +++ b/pyflakes/test/test_imports.py @@ -767,6 +767,12 @@ class Test(TestCase): fu.x ''') + self.flakes(''' + import fu.bar + import fu + fu.x + ''') + def test_unused_package_with_submodule_import(self): """ When a package and its submodule are imported, only report once. |
