Skip to content

Commit b82ebf2

Browse files
committed
Add tests.
1 parent b9ef8a0 commit b82ebf2

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| decorated_exports.py:3:33:3:45 | Str | The name 'not_defined' is exported by __all__ but is not defined. |
2+
| exports.py:1:57:1:64 | Str | The name 'nosuch' is exported by __all__ but is not defined. |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Variables/UndefinedExport.ql
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import dotted
2+
3+
__all__ = ["foo", "bar", "baz", "not_defined"]
4+
5+
6+
@dotted.decorator
7+
def foo():
8+
pass
9+
10+
@undotted_decorator
11+
def bar():
12+
pass
13+
14+
@not_imported.but_dotted
15+
def baz():
16+
pass
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
__all__ = ["foo", "bar", "baz", "quux", "blat", "frob", "nosuch", "i_got_it_elsewhere"]
2+
3+
with open("foo.txt") as f:
4+
foo = f.read()
5+
6+
b = open("bar.txt")
7+
bar = b.read()
8+
9+
baz = open("baz.txt")
10+
11+
from unknown_module import unknown_value
12+
13+
quux = 5 + unknown_value
14+
15+
blat = str(5)
16+
17+
frob = "5"
18+
19+
from unknown_module import i_got_it_elsewhere
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__all__ = ["foo"]
2+
3+
from unknown_module import *

0 commit comments

Comments
 (0)