diff --git a/tests/conftest.py b/tests/conftest.py index e69de29..94f83a2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -0,0 +1,7 @@ +import os +import sys + +if sys.platform == "darwin": + import atexit + + atexit.register(lambda: os.kill(os.getpid(), 9)) diff --git a/tests/run_tests.py b/tests/run_tests.py index 5dd8765..25b47c5 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -6,10 +6,11 @@ import subprocess if __name__ == "__main__": - # CTRE's library tends to crash on OSX at program exit, so - # don't bother running the tests in CI - if sys.platform != "darwin": - root = abspath(dirname(__file__)) - os.chdir(root) + root = abspath(dirname(__file__)) + os.chdir(root) + try: subprocess.check_call([sys.executable, "-m", "pytest"]) + except subprocess.CalledProcessError as e: + if not (sys.platform == "darwin" and e.returncode == 137): + raise