nixos/test: let python driver evaluate test code in global scope so the

user can define and use functions
This commit is contained in:
Jacek Galowicz 2019-11-20 18:57:52 +01:00
parent 855eb6f264
commit 4dba4db1db

View file

@ -749,7 +749,7 @@ def run_tests() -> None:
if tests is not None:
with log.nested("running the VM test script"):
try:
exec(tests)
exec(tests, globals())
except Exception as e:
eprint("error: {}".format(str(e)))
sys.exit(1)