(self, pytester: Pytester)
| 311 | result.stdout.fnmatch_lines(["*1 failed*2 passed*"]) |
| 312 | |
| 313 | def test_failedfirst_order(self, pytester: Pytester) -> None: |
| 314 | pytester.makepyfile( |
| 315 | test_a="def test_always_passes(): pass", |
| 316 | test_b="def test_always_fails(): assert 0", |
| 317 | ) |
| 318 | result = pytester.runpytest() |
| 319 | # Test order will be collection order; alphabetical |
| 320 | result.stdout.fnmatch_lines(["test_a.py*", "test_b.py*"]) |
| 321 | result = pytester.runpytest("--ff") |
| 322 | # Test order will be failing tests first |
| 323 | result.stdout.fnmatch_lines( |
| 324 | [ |
| 325 | "collected 2 items", |
| 326 | "run-last-failure: rerun previous 1 failure first", |
| 327 | "test_b.py*", |
| 328 | "test_a.py*", |
| 329 | ] |
| 330 | ) |
| 331 | |
| 332 | def test_lastfailed_failedfirst_order(self, pytester: Pytester) -> None: |
| 333 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected