MCPcopy
hub / github.com/pytest-dev/pytest / test_conftest_import_error_repr

Function test_conftest_import_error_repr

testing/test_config.py:2678–2689  ·  view source on GitHub ↗

`ConftestImportFailure` should use a short error message and readable path to the failed conftest.py file.

(tmp_path: Path)

Source from the content-addressed store, hash-verified

2676
2677
2678def test_conftest_import_error_repr(tmp_path: Path) -> None:
2679 """`ConftestImportFailure` should use a short error message and readable
2680 path to the failed conftest.py file."""
2681 path = tmp_path.joinpath("foo/conftest.py")
2682 with pytest.raises(
2683 ConftestImportFailure,
2684 match=re.escape(f"RuntimeError: some error (from {path})"),
2685 ):
2686 try:
2687 raise RuntimeError("some error")
2688 except Exception as exc:
2689 raise ConftestImportFailure(path, cause=exc) from exc
2690
2691
2692def test_strtobool() -> None:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected