Skip to content

Commit e54b757

Browse files
committed
refactor: no need for maybe-u prefixes in test regexes
That was for Python 2, which we don't support anymore.
1 parent 036baa7 commit e54b757

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

tests/test_config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ def test_parse_errors(self):
190190
("[tool.coverage.run]\ntimid = \"maybe?\"\n", r"maybe[?]"),
191191
("[tool.coverage.run\n", None),
192192
('[tool.coverage.report]\nexclude_lines = ["foo("]\n',
193-
r"Invalid \[tool.coverage.report\].exclude_lines value u?'foo\(': " +
193+
r"Invalid \[tool.coverage.report\].exclude_lines value 'foo\(': " +
194194
r"(unbalanced parenthesis|missing \))"),
195195
('[tool.coverage.report]\npartial_branches = ["foo["]\n',
196-
r"Invalid \[tool.coverage.report\].partial_branches value u?'foo\[': " +
196+
r"Invalid \[tool.coverage.report\].partial_branches value 'foo\[': " +
197197
r"(unexpected end of regular expression|unterminated character set)"),
198198
('[tool.coverage.report]\npartial_branches_always = ["foo***"]\n',
199199
r"Invalid \[tool.coverage.report\].partial_branches_always value " +
200-
r"u?'foo\*\*\*': " +
200+
r"'foo\*\*\*': " +
201201
r"multiple repeat"),
202202
('[tool.coverage.run]\nconcurrency="foo"', "not a list"),
203203
("[tool.coverage.report]\nprecision=1.23", "not an integer"),

tests/test_data.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def test_cant_change_file_tracer_name(self):
314314
covdata.add_lines({"p1.foo": dict.fromkeys([1, 2, 3])})
315315
covdata.add_file_tracers({"p1.foo": "p1.plugin"})
316316

317-
msg = "Conflicting file tracer name for 'p1.foo': u?'p1.plugin' vs u?'p1.plugin.foo'"
317+
msg = "Conflicting file tracer name for 'p1.foo': 'p1.plugin' vs 'p1.plugin.foo'"
318318
with pytest.raises(CoverageException, match=msg):
319319
covdata.add_file_tracers({"p1.foo": "p1.plugin.foo"})
320320

@@ -401,11 +401,11 @@ def test_update_conflicting_file_tracers(self):
401401
covdata2.add_lines({"p1.html": dict.fromkeys([1, 2, 3])})
402402
covdata2.add_file_tracers({"p1.html": "html.other_plugin"})
403403

404-
msg = "Conflicting file tracer name for 'p1.html': u?'html.plugin' vs u?'html.other_plugin'"
404+
msg = "Conflicting file tracer name for 'p1.html': 'html.plugin' vs 'html.other_plugin'"
405405
with pytest.raises(CoverageException, match=msg):
406406
covdata1.update(covdata2)
407407

408-
msg = "Conflicting file tracer name for 'p1.html': u?'html.other_plugin' vs u?'html.plugin'"
408+
msg = "Conflicting file tracer name for 'p1.html': 'html.other_plugin' vs 'html.plugin'"
409409
with pytest.raises(CoverageException, match=msg):
410410
covdata2.update(covdata1)
411411

@@ -417,11 +417,11 @@ def test_update_file_tracer_vs_no_file_tracer(self):
417417
covdata2 = DebugCoverageData(suffix="2")
418418
covdata2.add_lines({"p1.html": dict.fromkeys([1, 2, 3])})
419419

420-
msg = "Conflicting file tracer name for 'p1.html': u?'html.plugin' vs u?''"
420+
msg = "Conflicting file tracer name for 'p1.html': 'html.plugin' vs ''"
421421
with pytest.raises(CoverageException, match=msg):
422422
covdata1.update(covdata2)
423423

424-
msg = "Conflicting file tracer name for 'p1.html': u?'' vs u?'html.plugin'"
424+
msg = "Conflicting file tracer name for 'p1.html': '' vs 'html.plugin'"
425425
with pytest.raises(CoverageException, match=msg):
426426
covdata2.update(covdata1)
427427

tests/test_html.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def test_cant_find_static_files(self):
607607
self.make_file("main.py", "print(17)")
608608
cov = coverage.Coverage()
609609
self.start_import_stop(cov, "main")
610-
msg = "Couldn't find static file u?'.*'"
610+
msg = "Couldn't find static file '.*'"
611611
with pytest.raises(CoverageException, match=msg):
612612
cov.html_report()
613613

tests/test_process.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1788,11 +1788,11 @@ def test_us_in_venv_isnt_measured(self, coverage_command):
17881788
print(re_lines(debug_out, "myproduct"))
17891789
assert re_lines(
17901790
debug_out,
1791-
r"^Not tracing .*\bmyproduct.py': module u?'myproduct' falls outside the --source spec"
1791+
r"^Not tracing .*\bmyproduct.py': module 'myproduct' falls outside the --source spec"
17921792
)
17931793
assert re_lines(
17941794
debug_out,
1795-
r"^Not tracing .*\bcolorsys.py': module u?'colorsys' falls outside the --source spec"
1795+
r"^Not tracing .*\bcolorsys.py': module 'colorsys' falls outside the --source spec"
17961796
)
17971797

17981798
out = run_in_venv("python -m coverage report")

0 commit comments

Comments
 (0)