def test_exit_on_collection_error(pytester: Pytester) -> None:
    """Verify that all collection errors are collected and no tests executed"""
    pytester.makepyfile(**COLLECTION_ERROR_PY_FILES)

    res = pytester.runpytest()
    assert res.ret == 2

    res.stdout.fnmatch_lines(
        [
            "collected 2 items / 2 errors",
            "*ERROR collecting test_02_import_error.py*",
            "*No module named *asdfa*",
            "*ERROR collecting test_03_import_error.py*",
            "*No module named *asdfa*",
        ]
    )
Verify that all collection errors are collected and no tests executed
testing/test_collection.py