`ConftestImportFailure` should use a short error message and readable path to the failed conftest.py file.
(tmp_path: Path)
| 2676 | |
| 2677 | |
| 2678 | def 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 | |
| 2692 | def test_strtobool() -> None: |
nothing calls this directly
no test coverage detected