diff options
author | joshpere <devnull@localhost> | 2016-04-14 12:18:29 -0700 |
---|---|---|
committer | joshpere <devnull@localhost> | 2016-04-14 12:18:29 -0700 |
commit | a7641bd69c70cf2a98a114ddd8abb09256322789 (patch) | |
tree | 9fe5f268639062dfcd797e8fe23a63fde4df57b5 | |
parent | b7339866040d05986ffc5ca2a1c275c9a56fb3fa (diff) | |
download | tox-a7641bd69c70cf2a98a114ddd8abb09256322789.tar.gz |
Cleanup: Extract duplicate code
-rw-r--r-- | tox/venv.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tox/venv.py b/tox/venv.py index c75b75e..a943ec4 100644 --- a/tox/venv.py +++ b/tox/venv.py @@ -95,7 +95,7 @@ class VirtualEnv(object): if venv: path = self._venv_lookup(name) else: - path = py.path.local.sysfind(name) + path = self._normal_lookup(name) if path is None: raise tox.exception.InvocationError( @@ -106,7 +106,7 @@ class VirtualEnv(object): def _venv_lookup(self, name): path = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) if path is None: - path = py.path.local.sysfind(name) + path = self._normal_lookup(name) if not self.is_allowed_external(path): self.session.report.warning( "test command found but not installed in testenv\n" @@ -117,6 +117,9 @@ class VirtualEnv(object): path, self.envconfig.envdir)) return path + def _normal_lookup(self, name): + return py.path.local.sysfind(name) + def is_allowed_external(self, p): tryadd = [""] if sys.platform == "win32": |