diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2019-05-23 08:53:09 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-05-23 08:54:25 +0200 |
commit | 3bfec9f63b53abd11131c164c4fa941ee1743286 (patch) | |
tree | 4c6b3135caf1c7b78fd21ec9d19fa67ea49b08eb /pylint/test/functional | |
parent | b657df6644740e77fa167d4f95c76c4c007d2a49 (diff) | |
download | pylint-git-3bfec9f63b53abd11131c164c4fa941ee1743286.tar.gz |
``unused-import`` emitted for the right import names in function scopes.
Close #2928
Diffstat (limited to 'pylint/test/functional')
-rw-r--r-- | pylint/test/functional/unused_variable.py | 5 | ||||
-rw-r--r-- | pylint/test/functional/unused_variable.txt | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/pylint/test/functional/unused_variable.py b/pylint/test/functional/unused_variable.py index 4e6d58fe4..e475a9038 100644 --- a/pylint/test/functional/unused_variable.py +++ b/pylint/test/functional/unused_variable.py @@ -53,3 +53,8 @@ def locals_does_not_account_for_subscopes(): def unused_import_from(): from functools import wraps as abc # [unused-import] from collections import namedtuple # [unused-import] + + +def unused_import_in_function(value): + from six import PY2, text_type # [unused-import] + return value.encode("utf-8") if PY2 else value diff --git a/pylint/test/functional/unused_variable.txt b/pylint/test/functional/unused_variable.txt index 231528be3..e9f7ef022 100644 --- a/pylint/test/functional/unused_variable.txt +++ b/pylint/test/functional/unused_variable.txt @@ -10,3 +10,4 @@ unused-variable:41:locals_example_defined_after:Unused variable 'value' unused-variable:46:locals_does_not_account_for_subscopes:Unused variable 'value' unused-import:54:unused_import_from:Unused wraps imported from functools as abc unused-import:55:unused_import_from:Unused namedtuple imported from collections +unused-import:59:unused_import_in_function:Unused text_type imported from six |