|
33 | 33 | }
|
34 | 34 | RE_COLORS = {k: re.escape(v) for k, v in COLORS.items()}
|
35 | 35 |
|
| 36 | +TRANS_FNMATCH = str.maketrans({"[": "[[]", "]": "[]]"}) |
| 37 | + |
36 | 38 |
|
37 | 39 | class Option:
|
38 | 40 | def __init__(self, verbosity=0):
|
@@ -1772,14 +1774,19 @@ def test_teardown_many(self, testdir, many_files):
|
1772 | 1774 | [r"test_bar.py (\.E){5}\s+\[ 25%\]", r"test_foo.py (\.E){15}\s+\[100%\]"]
|
1773 | 1775 | )
|
1774 | 1776 |
|
1775 |
| - def test_teardown_many_verbose(self, testdir, many_files): |
1776 |
| - output = testdir.runpytest("-v") |
1777 |
| - output.stdout.re_match_lines( |
| 1777 | + def test_teardown_many_verbose(self, testdir: Testdir, many_files) -> None: |
| 1778 | + result = testdir.runpytest("-v") |
| 1779 | + result.stdout.fnmatch_lines( |
1778 | 1780 | [
|
1779 |
| - r"test_bar.py::test_bar\[0\] PASSED\s+\[ 5%\]", |
1780 |
| - r"test_bar.py::test_bar\[0\] ERROR\s+\[ 5%\]", |
1781 |
| - r"test_bar.py::test_bar\[4\] PASSED\s+\[ 25%\]", |
1782 |
| - r"test_bar.py::test_bar\[4\] ERROR\s+\[ 25%\]", |
| 1781 | + line.translate(TRANS_FNMATCH) |
| 1782 | + for line in [ |
| 1783 | + "test_bar.py::test_bar[0] PASSED * [ 5%]", |
| 1784 | + "test_bar.py::test_bar[0] ERROR * [ 5%]", |
| 1785 | + "test_bar.py::test_bar[4] PASSED * [ 25%]", |
| 1786 | + "test_foo.py::test_foo[14] PASSED * [100%]", |
| 1787 | + "test_foo.py::test_foo[14] ERROR * [100%]", |
| 1788 | + "=* 20 passed, 20 errors in *", |
| 1789 | + ] |
1783 | 1790 | ]
|
1784 | 1791 | )
|
1785 | 1792 |
|
|
0 commit comments