From 10688425c98d89ddb4c4c1fe0f27966a63dbb3fa Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Thu, 3 Dec 2026 08:45:51 -0700 Subject: [PATCH] Tests: hide the running harness from in-process calls too, so the suite passes inside any harness Co-Authored-By: Claude Opus 5.5 --- tests/test_core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_core.py b/tests/test_core.py index 8bada42..fda697b 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -94,6 +94,11 @@ class Core(unittest.TestCase): PYTHONPATH=py + (os.pathsep + os.environ["PYTHONPATH"] if os.environ.get("PYTHONPATH") else "")) for name in ("SISI_SESSION_ID", "CLAUDE_ENV_FILE", "XDG_DATA_HOME", "XDG_STATE_HOME", "CODEX_HOME", "CLAUDE_CODE_ENTRYPOINT"): self.env.pop(name, None) + # in-process calls read os.environ: the harness this suite runs under must not leak in either + hide = mock.patch.dict(os.environ) + hide.start() + self.addCleanup(hide.stop) + os.environ.pop("CLAUDE_CODE_ENTRYPOINT", None) self.proj = self.project("alpha") if not self.ENFORCE: # these tests hold the reminders; tests/test_plan.py holds the denials os.makedirs(self.data, exist_ok=True)