Skip to content

Commit dc5c0f8

Browse files
committed
Python: Add test case for missing modules
1 parent 2e5af67 commit dc5c0f8

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
| imports_test.py:21:1:21:20 | from module import * | Using 'from ... import *' pollutes the namespace |
22
| imports_test.py:22:1:22:32 | from module_without_all import * | Using 'from ... import *' pollutes the namespace |
3+
| imports_test.py:65:1:65:40 | from module_that_does_not_exist import * | Using 'from ... import *' pollutes the namespace |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
| imports_test.py:22:1:22:32 | from module_without_all import * | Import pollutes the enclosing namespace, as the imported module $@ does not define '__all__'. | module_without_all.py:0:0:0:0 | Module module_without_all | module_without_all |
2+
| imports_test.py:65:1:65:40 | from module_that_does_not_exist import * | Import pollutes the enclosing namespace, as the imported module $@ does not define '__all__'. | file://:0:0:0:0 | Missing module module_that_does_not_exist | module_that_does_not_exist |

python/ql/test/query-tests/Imports/general/imports_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ def __init__(self):
6161
#Use it
6262
different
6363

64+
# FP reported in https://github.com/github/codeql/issues/4003
65+
from module_that_does_not_exist import *

0 commit comments

Comments
 (0)