summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 81ec9f77..11d7aece 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -14,6 +14,7 @@ import warnings
import pytest
from coverage import env
+from coverage.misc import StopEverything
# Pytest will rewrite assertions in test modules, but not elsewhere.
@@ -92,3 +93,11 @@ def fix_xdist_sys_path():
del os.environ['PYTHONPATH']
except KeyError:
pass
+
+
+@pytest.hookimpl(hookwrapper=True)
+def pytest_runtest_call(item):
+ """Convert StopEverything into skipped tests."""
+ outcome = yield
+ if outcome.excinfo and issubclass(outcome.excinfo[0], StopEverything):
+ pytest.skip("Skipping {} for StopEverything: {}".format(item.nodeid, outcome.excinfo[1]))