Skip to content

Commit 44c9407

Browse files
authored
Merge pull request #4868 from blueyed/pytester-unset-PYTEST_ADDOPTS
pytester: unset PYTEST_ADDOPTS
2 parents 84555c8 + db5cc35 commit 44c9407

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

changelog/4851.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytester unsets ``PYTEST_ADDOPTS`` now to not use outer options with ``testdir.runpytest()``.

src/_pytest/pytester.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ def __init__(self, request, tmpdir_factory):
509509
self.test_tmproot = tmpdir_factory.mktemp("tmp-" + name, numbered=True)
510510
os.environ["PYTEST_DEBUG_TEMPROOT"] = str(self.test_tmproot)
511511
os.environ.pop("TOX_ENV_DIR", None) # Ensure that it is not used for caching.
512+
os.environ.pop("PYTEST_ADDOPTS", None) # Do not use outer options.
512513
self.plugins = []
513514
self._cwd_snapshot = CwdSnapshot()
514515
self._sys_path_snapshot = SysPathsSnapshot()

0 commit comments

Comments
 (0)