diff options
-rw-r--r-- | tests/test_execfile.py | 7 | ||||
-rw-r--r-- | tests/test_process.py | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_execfile.py b/tests/test_execfile.py index 21cbb727..b7a09902 100644 --- a/tests/test_execfile.py +++ b/tests/test_execfile.py @@ -10,6 +10,7 @@ import os.path import pathlib import py_compile import re +import sys import pytest @@ -26,6 +27,12 @@ TRY_EXECFILE = os.path.join(TESTS_DIR, "modules/process_test/try_execfile.py") class RunFileTest(CoverageTest): """Test cases for `run_python_file`.""" + @pytest.fixture(autouse=True) + def clean_up(self): + """These tests all run in-process. Clean up global changes.""" + yield + sys.excepthook = sys.__excepthook__ + def test_run_python_file(self): run_python_file([TRY_EXECFILE, "arg1", "arg2"]) mod_globs = json.loads(self.stdout()) diff --git a/tests/test_process.py b/tests/test_process.py index 7d7875d0..e048bdc2 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -1092,6 +1092,8 @@ class EnvironmentTest(CoverageTest): class ExcepthookTest(CoverageTest): """Tests of sys.excepthook support.""" + # TODO: do we need these as process tests if we have test_execfile.py:RunFileTest? + def test_excepthook(self): self.make_file("excepthook.py", """\ import sys |