Skip to content
Snippets Groups Projects
Commit b926ef57 authored by Daniel Brown's avatar Daniel Brown
Browse files

making sure tests run in correct directory

parent 2ee4f923
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,8 @@ class bcolors: ...@@ -14,6 +14,8 @@ class bcolors:
errors = [] errors = []
testdir = os.getcwd()
print("----------------------------------------------------------------------------------------") print("----------------------------------------------------------------------------------------")
for path, folders, files in os.walk("./test_scripts"): for path, folders, files in os.walk("./test_scripts"):
...@@ -25,6 +27,7 @@ for path, folders, files in os.walk("./test_scripts"): ...@@ -25,6 +27,7 @@ for path, folders, files in os.walk("./test_scripts"):
with open(filename) as f: with open(filename) as f:
print("RUNNING: " + filename) print("RUNNING: " + filename)
try: try:
os.chdir(path)
code = compile(f.read(), filename, 'exec') code = compile(f.read(), filename, 'exec')
exec(code) exec(code)
except Exception as ex: except Exception as ex:
...@@ -33,7 +36,8 @@ for path, folders, files in os.walk("./test_scripts"): ...@@ -33,7 +36,8 @@ for path, folders, files in os.walk("./test_scripts"):
traceback.print_exc() traceback.print_exc()
errors.append(filename) errors.append(filename)
print(bcolors.ENDC) print(bcolors.ENDC)
finally:
os.chdir(testdir)
print("----------------------------------------------------------------------------------------") print("----------------------------------------------------------------------------------------")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment