diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 1e919e3b6..5665e37f5 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -352,29 +352,21 @@ def gwork(q): assert re.search(r"TOTAL \d+ 0 100%", last_line) def test_bad_concurrency(self): - self.make_file("prog.py", "a = 1") - msg = "Unknown concurrency choices: nothing" - with pytest.raises(ConfigError, match=msg): + with pytest.raises(ConfigError, match="Unknown concurrency choices: nothing"): self.command_line("run --concurrency=nothing prog.py") def test_bad_concurrency_in_config(self): - self.make_file("prog.py", "a = 1") self.make_file(".coveragerc", "[run]\nconcurrency = nothing\n") - msg = "Unknown concurrency choices: nothing" - with pytest.raises(ConfigError, match=msg): + with pytest.raises(ConfigError, match="Unknown concurrency choices: nothing"): self.command_line("run prog.py") def test_no_multiple_light_concurrency(self): - self.make_file("prog.py", "a = 1") - msg = "Conflicting concurrency settings: eventlet, gevent" - with pytest.raises(ConfigError, match=msg): + with pytest.raises(ConfigError, match="Conflicting concurrency settings: eventlet, gevent"): self.command_line("run --concurrency=gevent,eventlet prog.py") def test_no_multiple_light_concurrency_in_config(self): - self.make_file("prog.py", "a = 1") self.make_file(".coveragerc", "[run]\nconcurrency = gevent, eventlet\n") - msg = "Conflicting concurrency settings: eventlet, gevent" - with pytest.raises(ConfigError, match=msg): + with pytest.raises(ConfigError, match="Conflicting concurrency settings: eventlet, gevent"): self.command_line("run prog.py")