make tests chaange dir
+import os
import pathlib
import subprocess
@@ -5,8 +6,14 @@ LIBRARY_ROOT = pathlib.Path(__file__).parent.parent.resolve()
def run_tests(_, remaining):
+ original_cwd = os.getcwd()
+ os.chdir(LIBRARY_ROOT)
+
+ try:
command = " ".join(
["pytest"] + remaining + ["--pyargs", "pymedphys", "--failed-first"]
)
subprocess.check_call(command, shell=True)
+ finally:
+ os.chdir(original_cwd)
