Verify that all collection errors are collected and no tests executed
(pytester: Pytester)
| 905 | |
| 906 | |
| 907 | def test_exit_on_collection_error(pytester: Pytester) -> None: |
| 908 | """Verify that all collection errors are collected and no tests executed""" |
| 909 | pytester.makepyfile(**COLLECTION_ERROR_PY_FILES) |
| 910 | |
| 911 | res = pytester.runpytest() |
| 912 | assert res.ret == 2 |
| 913 | |
| 914 | res.stdout.fnmatch_lines( |
| 915 | [ |
| 916 | "collected 2 items / 2 errors", |
| 917 | "*ERROR collecting test_02_import_error.py*", |
| 918 | "*No module named *asdfa*", |
| 919 | "*ERROR collecting test_03_import_error.py*", |
| 920 | "*No module named *asdfa*", |
| 921 | ] |
| 922 | ) |
| 923 | |
| 924 | |
| 925 | def test_exit_on_collection_with_maxfail_smaller_than_n_errors( |
nothing calls this directly
no test coverage detected