diff options
-rw-r--r-- | tests/test_z_cmdline.py | 13 | ||||
-rw-r--r-- | tox/_cmdline.py | 9 |
2 files changed, 20 insertions, 2 deletions
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py index 53fef28..283c993 100644 --- a/tests/test_z_cmdline.py +++ b/tests/test_z_cmdline.py @@ -191,6 +191,19 @@ def test_minversion(cmd, initproj): ]) assert result.ret +def test_run_custom_install_command_error(cmd, initproj): + initproj("interp123-0.5", filedefs={ + 'tox.ini': ''' + [testenv] + install_command=./tox.ini {opts} {packages} + ''' + }) + result = cmd.run("tox") + result.stdout.fnmatch_lines([ + "ERROR: invocation failed, args: ['*/tox.ini*", + ]) + assert result.ret + def test_unknown_interpreter_and_env(cmd, initproj): initproj("interp123-0.5", filedefs={ 'tests': {'test_hello.py': "def test_hello(): pass"}, diff --git a/tox/_cmdline.py b/tox/_cmdline.py index 5d58a18..aed71ec 100644 --- a/tox/_cmdline.py +++ b/tox/_cmdline.py @@ -92,8 +92,13 @@ class Action(object): if cwd is None: # XXX cwd = self.session.config.cwd cwd = py.path.local() - popen = self._popen(args, cwd, env=env, - stdout=f, stderr=STDOUT) + try: + popen = self._popen(args, cwd, env=env, + stdout=f, stderr=STDOUT) + except OSError: + self.report.error("invocation failed, args: %s, cwd: %s" % + (args, cwd)) + raise popen.outpath = outpath popen.args = [str(x) for x in args] popen.cwd = cwd |