Skip to content

Commit b578c12

Browse files
committed
Ensure variables inside the venv
1 parent bd072d1 commit b578c12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_venv.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ def test_pythonpath_usage(self, newmocksession, monkeypatch):
573573
assert 'PYTHONPATH' not in os.environ
574574
mocksession.report.expect("warning", "*Discarding $PYTHONPATH from environment*")
575575

576+
l = mocksession._pcalls
577+
assert len(l) == 1
578+
assert 'PYTHONPATH' not in l[0].env
579+
576580
# passenv = PYTHONPATH allows PYTHONPATH to stay in environment
577581
monkeypatch.setenv("PYTHONPATH", "/my/awesome/library")
578582
mocksession = newmocksession([], """
@@ -586,6 +590,10 @@ def test_pythonpath_usage(self, newmocksession, monkeypatch):
586590
assert 'PYTHONPATH' in os.environ
587591
mocksession.report.not_expect("warning", "*Discarding $PYTHONPATH from environment*")
588592

593+
l = mocksession._pcalls
594+
assert len(l) == 2
595+
assert l[1].env['PYTHONPATH'] == '/my/awesome/library'
596+
589597

590598
def test_env_variables_added_to_pcall(tmpdir, mocksession, newconfig, monkeypatch):
591599
pkg = tmpdir.ensure("package.tar.gz")

0 commit comments

Comments
 (0)