Verify tests are executed even when collection errors occur and that maxfail is honoured (including the collection error count). 4 tests: 2 collection errors + 1 failure + 1 success test_4 is never executed because the test run is with --maxfail=3 which means it is interrupted a
(pytester: Pytester)
| 985 | |
| 986 | |
| 987 | def test_continue_on_collection_errors_maxfail(pytester: Pytester) -> None: |
| 988 | """ |
| 989 | Verify tests are executed even when collection errors occur and that maxfail |
| 990 | is honoured (including the collection error count). |
| 991 | 4 tests: 2 collection errors + 1 failure + 1 success |
| 992 | test_4 is never executed because the test run is with --maxfail=3 which |
| 993 | means it is interrupted after the 2 collection errors + 1 failure. |
| 994 | """ |
| 995 | pytester.makepyfile(**COLLECTION_ERROR_PY_FILES) |
| 996 | |
| 997 | res = pytester.runpytest("--continue-on-collection-errors", "--maxfail=3") |
| 998 | assert res.ret == 1 |
| 999 | |
| 1000 | res.stdout.fnmatch_lines(["collected 2 items / 2 errors", "*1 failed, 2 errors*"]) |
| 1001 | |
| 1002 | |
| 1003 | def test_fixture_scope_sibling_conftests(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected