diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-09 06:06:06 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-09 06:06:06 -0500 |
commit | dacea2d09a383db32bb4620a987076b02fe009f8 (patch) | |
tree | bc17bd089828bebaf52c71163c7a1fd3ceec0727 /tests/test_concurrency.py | |
parent | 5f2914159e8cf4c5130dcd269c61e12ba0050190 (diff) | |
download | python-coveragepy-git-dacea2d09a383db32bb4620a987076b02fe009f8.tar.gz |
refactor(test): simplify these tests
Diffstat (limited to 'tests/test_concurrency.py')
-rw-r--r-- | tests/test_concurrency.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 1e919e3b..5665e37f 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -352,29 +352,21 @@ class ConcurrencyTest(CoverageTest): 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") |