Import scripts/validate-install-docs.py as a module so we can call `main(root=...)` directly without spawning a subprocess.
()
| 32 | |
| 33 | @pytest.fixture |
| 34 | def validator_module(): |
| 35 | """Import scripts/validate-install-docs.py as a module so we can call |
| 36 | `main(root=...)` directly without spawning a subprocess.""" |
| 37 | spec = importlib.util.spec_from_file_location("validate_install_docs", SCRIPT_PATH) |
| 38 | assert spec and spec.loader, "spec_from_file_location returned None" |
| 39 | mod = importlib.util.module_from_spec(spec) |
| 40 | sys.modules["validate_install_docs"] = mod |
| 41 | spec.loader.exec_module(mod) |
| 42 | return mod |
| 43 | |
| 44 | |
| 45 | def _make_root(tmp_path: Path, *, docs: dict[str, str], script: str) -> Path: |
nothing calls this directly
no outgoing calls
no test coverage detected