summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2015-12-09 12:05:51 +0100
committerholger krekel <holger@merlinux.eu>2015-12-09 12:05:51 +0100
commite0f22d570e4c242c64e41bb78b4fcfd57fcb79ca (patch)
treea25ab3c8c5ea6b47dd225b36043a561153c6d124
parent0727c11dc89eac86c14ac87f049f7f7b184fe720 (diff)
downloadtox-e0f22d570e4c242c64e41bb78b4fcfd57fcb79ca.tar.gz
some small refactorings
-rw-r--r--tox/session.py2
-rw-r--r--tox/venv.py20
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