diff options
author | Rebecka Gulliksson <rebecka.gulliksson@umu.se> | 2015-08-24 12:57:09 +0200 |
---|---|---|
committer | Rebecka Gulliksson <rebecka.gulliksson@umu.se> | 2015-08-24 12:57:09 +0200 |
commit | a92dc9d0877fb3bd4c39671af6fd36018bfc23b0 (patch) | |
tree | b40b6cff6c223e169fcf48604d47114128420fb2 | |
parent | 49353a0c473ba0bf61f9a027a96a6689eb50f6d5 (diff) | |
download | tox-a92dc9d0877fb3bd4c39671af6fd36018bfc23b0.tar.gz |
Renamed testenv attribute from 'voting' to 'ignore_outcome'.
-rw-r--r-- | tests/test_config.py | 8 | ||||
-rw-r--r-- | tests/test_venv.py | 10 | ||||
-rw-r--r-- | tox/config.py | 6 | ||||
-rw-r--r-- | tox/venv.py | 9 |
4 files changed, 17 insertions, 16 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 134d368..f0a8df0 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -598,7 +598,7 @@ class TestConfigTestEnv: int_hashseed = int(hashseed) # hashseed is random by default, so we can't assert a specific value. assert int_hashseed > 0 - assert envconfig.voting is True + assert envconfig.ignore_outcome is False def test_sitepackages_switch(self, tmpdir, newconfig): config = newconfig(["--sitepackages"], "") @@ -1216,13 +1216,13 @@ class TestConfigTestEnv: assert [d.name for d in configs["py27-django1.6"].deps] \ == ["Django==1.6"] - def test_voting(self, newconfig): + def test_ignore_outcome(self, newconfig): inisource = """ [testenv] - voting=False + ignore_outcome=True """ config = newconfig([], inisource).envconfigs - assert config["python"].voting is False + assert config["python"].ignore_outcome is True class TestGlobalOptions: diff --git a/tests/test_venv.py b/tests/test_venv.py index 730175a..b454f5b 100644 --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -7,6 +7,7 @@ import tox.config from tox.venv import * # noqa from tox.interpreters import NoInterpreterInfo + # def test_global_virtualenv(capfd): # v = VirtualEnv() # l = v.list() @@ -613,14 +614,15 @@ def test_command_relative_issue26(newmocksession, tmpdir, monkeypatch): mocksession.report.expect("warning", "*test command found but not*") -def test_non_voting_failing_cmd(newmocksession): +def test_ignore_outcome_failing_cmd(newmocksession): mocksession = newmocksession([], """ [testenv] commands=testenv_fail - voting=False + ignore_outcome=True """) venv = mocksession.getenv('python') venv.test() - assert venv.status == "non-voting fail" - mocksession.report.expect("warning", "*command failed, but testenv*")
\ No newline at end of file + assert venv.status == "ignored failed command" + mocksession.report.expect("warning", "*command failed but result from " + "testenv is ignored*") diff --git a/tox/config.py b/tox/config.py index fc85268..640e21d 100644 --- a/tox/config.py +++ b/tox/config.py @@ -474,9 +474,9 @@ def tox_addoption(parser): help="each line specifies a test command and can use substitution.") parser.add_testenv_attribute( - "voting", type="bool", default=True, - help="if set to False a failing result of this testenv will not make " - "tox fail") + "ignore_outcome", type="bool", default=False, + help="if set to True a failing result of this testenv will not make " + "tox fail, only a warning will be produced") class Config(object): diff --git a/tox/venv.py b/tox/venv.py index 75d5dfd..eaa555a 100644 --- a/tox/venv.py +++ b/tox/venv.py @@ -351,13 +351,12 @@ class VirtualEnv(object): self._pcall(argv, cwd=cwd, action=action, redirect=redirect, ignore_ret=ignore_ret, testcommand=True) except tox.exception.InvocationError as err: - if not self.envconfig.voting: + if self.envconfig.ignore_outcome: self.session.report.warning( - "command failed, but testenv is marked " - "non-voting.\n" + "command failed but result from testenv is ignored\n" " cmd: %s" % (str(err),)) - self.status = "non-voting fail" - continue # keep processing commands + self.status = "ignored failed command" + continue # keep processing commands self.session.report.error(str(err)) self.status = "commands failed" |