Merge pull request #2299 from ludovic111/fix/macos-python-tests

🤖 Agent: Merged by Ludovic's AI agent (Claude). Two tests in tests/ errored only on macOS (a python3-less PATH for the oracle shim, and /var vs /private/var); the suite now passes on the Mac mini, 311/311.
This commit is contained in:
Ludovic Marie
2026-10-26 17:53:36 +01:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -259,7 +259,11 @@ class OracleReuseTests(unittest.TestCase):
self.input, self.output = root / "work" / "in.txt", root / "work" / "out.txt"
self.input.parent.mkdir()
self.input.write_text("a")
python = Path(sys.executable).parent
# The shim starts with `#!/usr/bin/env python3`, and a Python's own folder may name it only
# python3.13 (Homebrew's): a python3 of its own keeps the PATH below enough.
python = root / "python"
python.mkdir()
(python / "python3").symlink_to(sys.executable)
self.env = dict(os.environ, PATH=f"{self.shim}:{self.bin}:{python}", PARITY_SHIM_REAL_PATH=str(self.bin),
PARITY_SHIM_CACHE=str(root / "cache"))
self.subprocess = subprocess
+3 -1
View File
@@ -10,7 +10,9 @@ from tools import test_rust_parity as parity
class ParityRunnerTests(unittest.TestCase):
def test_report_rejects_sources_changed_during_a_run(self):
with tempfile.TemporaryDirectory() as temp:
root = Path(temp)
# Resolved, as source_hashes resolves the sources: macOS's temp folder is a symlink
# (/var -> /private/var).
root = Path(temp).resolve()
source = root / "source.rs"
source.write_text("before")
with mock.patch.object(parity.lab, "ROOT", root):