diff options
-rw-r--r-- | tox/session.py | 2 | ||||
-rw-r--r-- | tox/venv.py | 20 |
2 files changed, 16 insertions, 6 deletions
diff --git a/tox/session.py b/tox/session.py index 5c99206..e5e654b 100644 --- a/tox/session.py +++ b/tox/session.py @@ -211,7 +211,7 @@ class Action(object): if sys.platform == "win32": ext = os.path.splitext(str(newargs[0]))[1].lower() if ext == '.py' and self.venv: - newargs = [str(self.venv.getcommandpath())] + newargs + newargs = [str(self.envconfig.envpython)] + newargs return newargs diff --git a/tox/venv.py b/tox/venv.py index 499c6f1..bed7fb7 100644 --- a/tox/venv.py +++ b/tox/venv.py @@ -56,19 +56,29 @@ class VirtualEnv(object): def __init__(self, envconfig=None, session=None): self.envconfig = envconfig self.session = session - self.path = envconfig.envdir - self.path_config = self.path.join(".tox-config1") + + @property + def path(self): + """ Path to environment base dir. """ + return self.envconfig.envdir + + @property + def path_config(self): + return self.path.join(".tox-config1") @property def name(self): + """ test environment name. """ return self.envconfig.envname def __repr__(self): return "<VirtualEnv at %r>" % (self.path) - def getcommandpath(self, name=None, venv=True, cwd=None): - if name is None: - return self.envconfig.envpython + def getcommandpath(self, name, venv=True, cwd=None): + """ return absolute path (str or localpath) for specified + command name. If venv is True we will check if the + command is coming from the venv or is whitelisted to come + from external. """ name = str(name) if os.path.isabs(name): return name |