From 06f73442e1cd81606122ebeea047621dadba047d Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 18 Nov 2026 10:16:19 +0000 Subject: [PATCH] test: clear task-worktree organ paths in conftest so the suite is hermetic A task worktree's activate.sh exports PYAUTO_ROOT/BRAIN/MIND/HEART/HANDS/TASK and resolvers honour them as hard overrides, so the suite failed locally (test_grouped_organ_consumers) while CI, which sets none, stayed green. An autouse fixture now starts every test from CI's environment. Closes #677 Co-Authored-By: Claude Opus 5.5 --- tests/conftest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 6593db7..0ff6b40 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -27,6 +27,18 @@ def _no_real_heart_lane(monkeypatch): monkeypatch.setenv("PYAUTO_HEART_GREEN", "off") +@pytest.fixture(autouse=True) +def _no_task_worktree_paths(monkeypatch): + """A task worktree's `activate.sh` (written by `bin/worktree.sh`) exports + the organ paths below, and resolvers honour them as hard overrides (e.g. + `_hygiene_repos.candidate_map_paths` and `PYAUTO_MIND`). CI sets none of + them, so start every test from CI's environment; a test that needs one + sets it itself (PyAutoBrain#677).""" + for name in ("PYAUTO_TASK", "PYAUTO_ROOT", "PYAUTO_BRAIN", "PYAUTO_MIND", + "PYAUTO_HEART", "PYAUTO_HANDS"): + monkeypatch.delenv(name, raising=False) + + @pytest.fixture(autouse=True) def _no_real_launch_probes(monkeypatch): """M3.6a (PyAutoBrain#659): `brief --check` and the watcher's first tick