diff --git a/tests/oo/test_oo_scoring_domain.py b/tests/oo/test_oo_scoring_domain.py index 77bb5e4..a6a0924 100644 --- a/tests/oo/test_oo_scoring_domain.py +++ b/tests/oo/test_oo_scoring_domain.py @@ -4,6 +4,7 @@ import ast import json +import subprocess from pathlib import Path from typing import TYPE_CHECKING @@ -86,6 +87,11 @@ def test_cli_exit_code_and_table( capsys: pytest.CaptureFixture[str], ) -> None: _fixture(tmp_path) + # The fixture stands for a project of its own: the gate names files + # from its repository root, so make tmp_path that root. Otherwise, with + # TMPDIR inside a checkout, the scratch root is the repository (see + # ``separate_project``) and the file reads ``/pkg/broken.py``. + subprocess.run(["git", "init", "-q"], cwd=tmp_path, check=True) monkeypatch.chdir(tmp_path) code = dispatch(["oo", "pkg"]) out = capsys.readouterr().out