MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_failedfirst_order

Method test_failedfirst_order

testing/test_cacheprovider.py:313–330  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected