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

Function test_stop_on_collection_errors

testing/test_stepwise.py:189–198  ·  view source on GitHub ↗

Stop during collection errors. Broken test first or broken test last actually surfaced a bug (#5444), so we test both situations.

(
    broken_pytester: Pytester, broken_first: bool
)

Source from the content-addressed store, hash-verified

187
188@pytest.mark.parametrize("broken_first", [True, False])
189def test_stop_on_collection_errors(
190 broken_pytester: Pytester, broken_first: bool
191) -> None:
192 """Stop during collection errors. Broken test first or broken test last
193 actually surfaced a bug (#5444), so we test both situations."""
194 files = ["working_testfile.py", "broken_testfile.py"]
195 if broken_first:
196 files.reverse()
197 result = broken_pytester.runpytest("-v", "--strict-markers", "--stepwise", *files)
198 result.stdout.fnmatch_lines("*error during collection*")
199
200
201def test_xfail_handling(pytester: Pytester, monkeypatch: MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 2

fnmatch_linesMethod · 0.80
runpytestMethod · 0.45

Tested by

no test coverage detected