Merge pull request #4382 from blueyed/pytester-pop-TOX_ENV_DIR

pytester: pop TOX_ENV_DIR from os.environ
This commit is contained in:
Daniel Hahler 2018-11-13 12:42:51 +01:00 committed by GitHub
commit a72eff5a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 11 deletions

View File

@ -502,6 +502,7 @@ class Testdir(object):
self.tmpdir = tmpdir_factory.mktemp(name, numbered=True) self.tmpdir = tmpdir_factory.mktemp(name, numbered=True)
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.
self.plugins = [] self.plugins = []
self._cwd_snapshot = CwdSnapshot() self._cwd_snapshot = CwdSnapshot()
self._sys_path_snapshot = SysPathsSnapshot() self._sys_path_snapshot = SysPathsSnapshot()

View File

@ -14,17 +14,6 @@ import pytest
pytest_plugins = ("pytester",) pytest_plugins = ("pytester",)
@pytest.fixture(scope="module", autouse=True)
def handle_env():
"""Ensure env is like most of the tests expect it, i.e. not using tox."""
orig_env = os.environ.pop("TOX_ENV_DIR", None)
yield
if orig_env is not None:
os.environ["TOX_ENV_DIR"] = orig_env
class TestNewAPI(object): class TestNewAPI(object):
def test_config_cache_makedir(self, testdir): def test_config_cache_makedir(self, testdir):
testdir.makeini("[pytest]") testdir.makeini("[pytest]")