Merge pull request #4868 from blueyed/pytester-unset-PYTEST_ADDOPTS

pytester: unset PYTEST_ADDOPTS
This commit is contained in:
Bruno Oliveira 2019-03-01 18:48:36 -03:00 committed by GitHub
commit 44c940765b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) self.test_tmproot = tmpdir_factory.mktemp("tmp-" + name, numbered=True)
os.environ["PYTEST_DEBUG_TEMPROOT"] = str(self.test_tmproot) 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("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.plugins = []
self._cwd_snapshot = CwdSnapshot() self._cwd_snapshot = CwdSnapshot()
self._sys_path_snapshot = SysPathsSnapshot() self._sys_path_snapshot = SysPathsSnapshot()