summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-08 11:26:14 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-08 11:42:19 -0400
commitee5d7ba0ad86068f9413a54659a2f8a58cd97f31 (patch)
tree512e61b7ff862fc6242ffb67fa4aaf8aa961e347
parentc163cdc44980bb39ec8b9031a38f58ed98766419 (diff)
downloadpython-coveragepy-git-ee5d7ba0ad86068f9413a54659a2f8a58cd97f31.tar.gz
test: this xdist defensiveness now seems unneeded
-rw-r--r--tests/conftest.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 81c13dd7..75adf3f2 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -7,7 +7,6 @@ Pytest auto configuration.
This module is run automatically by pytest, to define and enable fixtures.
"""
-import os
import sys
import warnings
@@ -66,31 +65,6 @@ def reset_sys_path():
sys.path[:] = sys_path
-@pytest.fixture(autouse=True)
-def fix_xdist_sys_path():
- """Prevent xdist from polluting the Python path.
-
- We run tests that care a lot about the contents of sys.path. Pytest-xdist
- changes sys.path, so running with xdist, vs without xdist, sets sys.path
- differently. With xdist, sys.path[1] is an empty string, without xdist,
- it's the virtualenv bin directory. We don't want the empty string, so
- clobber that entry.
-
- See: https://github.com/pytest-dev/pytest-xdist/issues/376
-
- """
- if os.environ.get('PYTEST_XDIST_WORKER', ''): # pragma: part covered
- # We are running in an xdist worker.
- if sys.path[1] == '':
- # xdist has set sys.path[1] to ''. Clobber it.
- del sys.path[1]
- # Also, don't let it sneak stuff in via PYTHONPATH.
- try:
- del os.environ['PYTHONPATH']
- except KeyError:
- pass
-
-
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_call(item):
"""Convert StopEverything into skipped tests."""