Skip to content
Snippets Groups Projects
Commit b2f19b8d authored by Damien George's avatar Damien George
Browse files

tests: Get builtin_compile to skin properly on pyboard.

parent 480a7ce5
No related branches found
No related tags found
No related merge requests found
# test compile builtin # test compile builtin
def have_compile():
try: try:
compile compile
return True
except NameError: except NameError:
print("SKIP") return False
import sys
sys.exit() # global variable for compiled code to access
x = 1
def test():
c = compile("print(x)", "file", "exec") c = compile("print(x)", "file", "exec")
try: try:
...@@ -14,8 +18,12 @@ try: ...@@ -14,8 +18,12 @@ try:
except NameError: except NameError:
print("NameError") print("NameError")
x = 1
exec(c) exec(c)
exec(c, {"x":2}) exec(c, {"x":2})
exec(c, {}, {"x":3}) exec(c, {}, {"x":3})
if have_compile():
test()
else:
print("SKIP")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment