summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Down <chris@chrisdown.name>2022-01-13 07:40:56 +0000
committerGitHub <noreply@github.com>2022-01-13 07:40:56 +0000
commit9cc692d85c9ce84344ea7fee4b127755c6099a32 (patch)
treeeb758db9008ecfc5d2e9b487df784efa892fec0a /src
parent86a0383c0617ff1d1ea47a526211bedc415c9d95 (diff)
downloadtox-git-master.tar.gz
venv: Do not fail for test commands that don't exist with "-" leader (#2316)master
Diffstat (limited to 'src')
-rw-r--r--src/tox/venv.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tox/venv.py b/src/tox/venv.py
index cdd6949a..87e01656 100644
--- a/src/tox/venv.py
+++ b/src/tox/venv.py
@@ -595,7 +595,17 @@ class VirtualEnv(object):
reporter.verbosity2("setting PATH={}".format(env["PATH"]))
# get command
- args[0] = self.getcommandpath(args[0], venv, cwd)
+ try:
+ args[0] = self.getcommandpath(args[0], venv, cwd)
+ except tox.exception.InvocationError:
+ if ignore_ret:
+ self.status = getattr(self, "status", 0)
+ msg = "command not found but explicitly ignored"
+ reporter.warning("{}\ncmd: {}".format(msg, args[0]))
+ return "" # in case it's returnout
+ else:
+ raise
+
if sys.platform != "win32" and "TOX_LIMITED_SHEBANG" in os.environ:
args = prepend_shebang_interpreter(args)