From ca38db63dba0a3e5299bc32f7de2d33212f27e4b Mon Sep 17 00:00:00 2001 From: Oz N Tiram Date: Thu, 4 Aug 2022 10:46:27 +0200 Subject: [PATCH] Use temp_environ in test for CUSTOM_VENV_NAME This is so that PIPENV_CUSTOM_VENV_NAME does not leak to other tests. --- tests/integration/test_dot_venv.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/integration/test_dot_venv.py b/tests/integration/test_dot_venv.py index c075aba7..319ebfcd 100644 --- a/tests/integration/test_dot_venv.py +++ b/tests/integration/test_dot_venv.py @@ -169,10 +169,11 @@ def test_venv_name_accepts_custom_name_environment_variable(PipenvInstance): """ with PipenvInstance(chdir=True, venv_in_project=False) as p: test_name = "sensible_custom_venv_name" - os.environ['PIPENV_CUSTOM_VENV_NAME'] = test_name - c = p.pipenv('install') - assert c.returncode == 0 - c = p.pipenv('--venv') - assert c.returncode == 0 - venv_path = c.stdout.strip() - assert test_name == Path(venv_path).parts[-1] + with temp_environ(): + os.environ['PIPENV_CUSTOM_VENV_NAME'] = test_name + c = p.pipenv('install') + assert c.returncode == 0 + c = p.pipenv('--venv') + assert c.returncode == 0 + venv_path = c.stdout.strip() + assert test_name == Path(venv_path).parts[-1]