Merge branch 'fix/kvb-check-score-isolated-import' into unify/skills-20261114

This commit is contained in:
Kevin Veen-Birkenbach committed 2026-11-14 21:51:10 +00:00
commit f315cf37e7
4 files changed
+18

No files matched your search

@@ -28,6 +28,8 @@ from collections import deque
from pathlib import Path from pathlib import Path
from typing import NamedTuple from typing import NamedTuple
sys.path.insert(0, str(Path(__file__).resolve().parent))
from journal import ( from journal import (
LABELS, LABELS,
append, append,
+2
View File
@@ -54,6 +54,8 @@ import sys
import time import time
from pathlib import Path from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
from journal import ( from journal import (
LABELS, LABELS,
append, append,
+9
View File
@@ -35,6 +35,15 @@ class TestScore(unittest.TestCase):
self.assertEqual(result.stderr, "") self.assertEqual(result.stderr, "")
return result.stdout.splitlines(), result.returncode return result.stdout.splitlines(), result.returncode
def test_runs_under_python_isolated_mode_from_another_directory(self):
with tempfile.TemporaryDirectory() as elsewhere:
result = subprocess.run(
[sys.executable, "-I", str(SCORE), *flags(BASE), "--message-block"],
cwd=elsewhere, env=ENV, capture_output=True, text=True, check=False,
)
self.assertEqual((result.returncode, result.stderr), (0, ""))
self.assertIn("🎯 Fix: 95 %", result.stdout)
def test_formula_and_line_format(self): def test_formula_and_line_format(self):
self.assertEqual( self.assertEqual(
self._score(fix="95", **{"break": "4"}), self._score(fix="95", **{"break": "4"}),
+5
View File
@@ -49,6 +49,11 @@ class TestBackfill(unittest.TestCase):
def rows(self, council: Path) -> list[dict]: def rows(self, council: Path) -> list[dict]:
return [json.loads(line) for line in (council / JOURNAL_NAME).read_text(encoding="utf-8").splitlines()] return [json.loads(line) for line in (council / JOURNAL_NAME).read_text(encoding="utf-8").splitlines()]
def test_runs_under_python_isolated_mode_from_another_directory(self):
done = subprocess.run([sys.executable, "-I", str(BACKFILL), "--help"], cwd=self.scratch, capture_output=True, text=True, check=False, timeout=HANG)
self.assertEqual((done.returncode, done.stderr), (0, ""))
self.assertIn("--repo", done.stdout)
def test_three_commits_with_blocks_give_three_rows_then_none(self): def test_three_commits_with_blocks_give_three_rows_then_none(self):
council = self.council("one") council = self.council("one")
first = backfill(council, "--repo", str(self.fixture.a)) first = backfill(council, "--repo", str(self.fixture.a))