pytester: unset PYTEST_ADDOPTS

This commit is contained in:
Daniel Hahler 2019-02-28 13:23:08 +01:00
parent 84555c89de
commit db5cc35b44
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
pytester unsets ``PYTEST_ADDOPTS`` now to not use outer options with ``testdir.runpytest()``.

View File

@ -509,6 +509,7 @@ class Testdir(object):
self.test_tmproot = tmpdir_factory.mktemp("tmp-" + name, numbered=True)
os.environ["PYTEST_DEBUG_TEMPROOT"] = str(self.test_tmproot)
os.environ.pop("TOX_ENV_DIR", None) # Ensure that it is not used for caching.
os.environ.pop("PYTEST_ADDOPTS", None) # Do not use outer options.
self.plugins = []
self._cwd_snapshot = CwdSnapshot()
self._sys_path_snapshot = SysPathsSnapshot()