Skip to content

Commit c768cbc

Browse files
committed
tests: harden test_xdist_verbose
1 parent a8fc056 commit c768cbc

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

testing/test_terminal.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,11 +1695,27 @@ def test_xdist_verbose(self, many_tests_files, testdir, monkeypatch):
16951695
pytest.importorskip("xdist")
16961696
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
16971697
output = testdir.runpytest("-n2", "-v")
1698-
output.stdout.re_match_lines_random(
1698+
output.stdout.fnmatch_lines(
16991699
[
1700-
r"\[gw\d\] \[\s*\d+%\] PASSED test_bar.py::test_bar\[1\]",
1701-
r"\[gw\d\] \[\s*\d+%\] PASSED test_foo.py::test_foo\[1\]",
1702-
r"\[gw\d\] \[\s*\d+%\] PASSED test_foobar.py::test_foobar\[1\]",
1700+
line.translate(TRANS_FNMATCH)
1701+
for line in [
1702+
"[gw?] [ 5%] PASSED test_bar.py::test_bar[?] ",
1703+
"[gw?] [ 10%] PASSED test_bar.py::test_bar[?] ",
1704+
"[gw?] [ 55%] PASSED test_foo.py::test_foo[?] ",
1705+
"[gw?] [ 60%] PASSED test_foo.py::test_foo[?] ",
1706+
"[gw?] [ 95%] PASSED test_foobar.py::test_foobar[?] ",
1707+
"[gw?] [100%] PASSED test_foobar.py::test_foobar[?] ",
1708+
]
1709+
]
1710+
)
1711+
output.stdout.fnmatch_lines_random(
1712+
[
1713+
line.translate(TRANS_FNMATCH)
1714+
for line in [
1715+
"test_bar.py::test_bar[0] ",
1716+
"test_foo.py::test_foo[0] ",
1717+
"test_foobar.py::test_foobar[0] ",
1718+
]
17031719
]
17041720
)
17051721

0 commit comments

Comments
 (0)