Skip to content

Commit

Permalink
pytester: unset PYTEST_ADDOPTS
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Feb 28, 2019
1 parent 7caf8e0 commit 2531b83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/4851.bugfix.rst
@@ -0,0 +1 @@
pytester unsets ``PYTEST_ADDOPTS`` now to not use outer options with ``testdir.runpytest()``.
1 change: 1 addition & 0 deletions src/_pytest/pytester.py
Expand Up @@ -509,6 +509,7 @@ def __init__(self, request, tmpdir_factory):
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()
Expand Down

0 comments on commit 2531b83

Please sign in to comment.