Skip to content

Commit 1077ce3

Browse files
committed
Python: Add FN for py/unused-import
1 parent 6685a5e commit 1077ce3

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

python/ql/test/query-tests/Imports/unused/UnusedImport.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
| import_structure_2.py:6:1:6:23 | Import | Import of 'bar' is not used. |
12
| imports_test.py:2:1:2:23 | Import | Import of 'module2' is not used. |
23
| imports_test.py:6:1:6:12 | Import | Import of 'cycle' is not used. |
34
| imports_test.py:10:1:10:22 | Import | Import of 'top_level_cycle' is not used. |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# there should be no difference whether you import 2 things on 1 line, or use 2
2+
# lines
3+
from typing import Optional
4+
5+
from unknown import foo, bar
6+
7+
8+
var: Optional['foo'] = None
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# there should be no difference whether you import 2 things on 1 line, or use 2
2+
# lines
3+
from typing import Optional
4+
5+
from unknown import foo
6+
from unknown import bar
7+
8+
var: Optional['foo'] = None

0 commit comments

Comments
 (0)