Skip to content

Commit 6278520

Browse files
committed
tests: Add test for compile builtin.
1 parent c9fc620 commit 6278520

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tests/basics/builtin_compile.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# test compile builtin
2+
3+
try:
4+
compile
5+
except NameError:
6+
print("SKIP")
7+
import sys
8+
sys.exit()
9+
10+
c = compile("print(x)", "file", "exec")
11+
12+
try:
13+
exec(c)
14+
except NameError:
15+
print("NameError")
16+
17+
x = 1
18+
exec(c)
19+
20+
exec(c, {"x":2})
21+
exec(c, {}, {"x":3})

0 commit comments

Comments
 (0)