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
)
| 187 | |
| 188 | @pytest.mark.parametrize("broken_first", [True, False]) |
| 189 | def 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 | |
| 201 | def test_xfail_handling(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: |
nothing calls this directly
no test coverage detected