-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false positive for
unused-import
when disabling both ``used-b…
…efore-assignment`` and ``undefined-variable`` (#6096) Co-authored-by: Jacob Walls <[email protected]>
- Loading branch information
1 parent
4213b3c
commit 7024743
Showing
4 changed files
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
tests/functional/u/unused/unused_import_everything_disabled.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
"""Test that unused-import is not emitted here when everything else is disabled | ||
https://github.com/PyCQA/pylint/issues/3445 | ||
https://github.com/PyCQA/pylint/issues/6089 | ||
""" | ||
from math import e, pi | ||
from os import environ | ||
|
||
for k, v in environ.items(): | ||
print(k, v) | ||
|
||
|
||
class MyClass: | ||
"""For the bug reported in #6089 it is important to use the same names for the class attributes as in the imports.""" | ||
|
||
e = float(e) | ||
pi = pi |