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

Method test_maxfailures

testing/test_terminal.py:1365–1384  ·  view source on GitHub ↗
(self, pytester: Pytester, option)

Source from the content-addressed store, hash-verified

1363 )
1364
1365 def test_maxfailures(self, pytester: Pytester, option) -> None:
1366 pytester.makepyfile(
1367 """
1368 def test_1():
1369 assert 0
1370 def test_2():
1371 assert 0
1372 def test_3():
1373 assert 0
1374 """
1375 )
1376 result = pytester.runpytest("--maxfail=2", *option.args)
1377 result.stdout.fnmatch_lines(
1378 [
1379 "*def test_1():*",
1380 "*def test_2():*",
1381 "*! stopping after 2 failures !*",
1382 "*2 failed*",
1383 ]
1384 )
1385
1386 def test_maxfailures_with_interrupted(self, pytester: Pytester) -> None:
1387 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