diff options
author | Mathieu Agopian <mathieu.agopian@gmail.com> | 2013-07-06 18:16:30 +0200 |
---|---|---|
committer | Mathieu Agopian <mathieu.agopian@gmail.com> | 2013-07-06 18:16:30 +0200 |
commit | 15b75acb0f8dfae1a03d0efa77a6c910d2c1be57 (patch) | |
tree | c00b50e4107b6764fae4e27d1fbf30fd824f69aa | |
parent | b2d878c43a48ffb4ffd6ead4f30d4db2b0456d46 (diff) | |
download | tox-15b75acb0f8dfae1a03d0efa77a6c910d2c1be57.tar.gz |
fixes #87 : unset VIRTUALENV_PYTHON before calling virtualenv
-rw-r--r-- | tests/test_z_cmdline.py | 9 | ||||
-rw-r--r-- | tox/_venv.py | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py index 6a57114..0208443 100644 --- a/tests/test_z_cmdline.py +++ b/tests/test_z_cmdline.py @@ -382,6 +382,15 @@ def test_env_PYTHONDONTWRITEBYTECODE(initproj, cmd, monkeypatch): "*create*", ]) +def test_env_VIRTUALENV_PYTHON(initproj, cmd, monkeypatch): + initproj("example123", filedefs={'tox.ini': ''}) + monkeypatch.setenv("VIRTUALENV_PYTHON", '/FOO') + result = cmd.run("tox", "-v", "--notest") + assert not result.ret, result.stdout.lines + result.stdout.fnmatch_lines([ + "*create*", + ]) + def test_sdistonly(initproj, cmd): initproj("example123", filedefs={'tox.ini': """ """}) diff --git a/tox/_venv.py b/tox/_venv.py index 5008c00..7d9d347 100644 --- a/tox/_venv.py +++ b/tox/_venv.py @@ -301,6 +301,10 @@ class VirtualEnv(object): def _pcall(self, args, venv=True, cwd=None, extraenv={}, action=None, redirect=True): + try: + del os.environ['VIRTUALENV_PYTHON'] + except KeyError: + pass assert cwd cwd.ensure(dir=1) old = self.patchPATH() |