From b7d0125cdbf041d7e0daea63e601f3c89403630d Mon Sep 17 00:00:00 2001 From: Jim Freeman Date: Tue, 1 Dec 2026 23:59:08 +0000 Subject: [PATCH] test: the CLI scoring test makes its package a repository of its own punt release runs make check with the shell's TMPDIR, which the workspace .envrc puts inside the checkout. separate_project then makes pytest's scratch root a repository, and the gate names the broken file from that root, so test_cli_exit_code_and_table failed the 0.9.0 release pre-flight: Before (TMPDIR inside the checkout): AssertionError: assert 'ERROR: pkg/broken.py could not be parsed' in '... ERROR: test_cli_exit_code_and_table0/pkg/broken.py could not be parsed ...' After: tests/oo/test_oo_scoring_domain.py passes (7 passed). --- tests/oo/test_oo_scoring_domain.py | 6 ++++++ 1 file changed, 6 insertions(+) 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