From 9e66006ad8071b286b8f4dcaa02113987b14ef02 Mon Sep 17 00:00:00 2001 From: Ionel Maries Cristian Date: Tue, 25 Mar 2014 02:59:17 +0200 Subject: Backed out changeset: 228071477cfb --- tests/test_venv.py | 7 +++++-- tox/_config.py | 2 +- tox/_venv.py | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/test_venv.py b/tests/test_venv.py index 77181d1..0ac8f90 100644 --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -48,8 +48,11 @@ def test_create(monkeypatch, mocksession, newconfig): l = mocksession._pcalls assert len(l) >= 1 args = l[0].args - assert str(args[0]).endswith("virtualenv") + assert "virtualenv" in str(args[1]) if sys.platform != "win32": + # realpath is needed for stuff like the debian symlinks + assert py.path.local(sys.executable).realpath() \ + == py.path.local(args[0]).realpath() #assert Envconfig.toxworkdir in args assert venv.getcommandpath("easy_install", cwd=py.path.local()) interp = venv._getliveconfig().python @@ -318,7 +321,7 @@ def test_install_python3(tmpdir, newmocksession): l = mocksession._pcalls assert len(l) == 1 args = l[0].args - assert str(args[0]).endswith('virtualenv') + assert str(args[1]).endswith('virtualenv.py') l[:] = [] action = mocksession.newaction(venv, "hello") venv._install(["hello"], action=action) diff --git a/tox/_config.py b/tox/_config.py index 928305c..6006fa9 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -357,7 +357,6 @@ class parseini: ixserver = None name = self._replace_forced_dep(name, config) vc.deps.append(DepConfig(name, ixserver)) - vc.virtualenvbin = reader.getdefault(section, "virtualenvbin", "virtualenv") vc.distribute = reader.getbool(section, "distribute", False) vc.sitepackages = self.config.option.sitepackages or \ reader.getbool(section, "sitepackages", False) @@ -735,3 +734,4 @@ def getcontextname(): if 'HUDSON_URL' in os.environ: return 'jenkins' return None + diff --git a/tox/_venv.py b/tox/_venv.py index 00f528a..1013460 100644 --- a/tox/_venv.py +++ b/tox/_venv.py @@ -178,8 +178,13 @@ class VirtualEnv(object): if action is None: action = self.session.newaction(self, "create") + interpreters = self.envconfig.config.interpreters config_interpreter = self.getsupportedinterpreter() - args = [self.envconfig.virtualenvbin] + info = interpreters.get_info(executable=config_interpreter) + f, path, _ = py.std.imp.find_module("virtualenv") + f.close() + venvscript = path.rstrip("co") + args = [config_interpreter, str(venvscript)] if self.envconfig.distribute: args.append("--distribute") else: -- cgit v1.2.1