"""Keep the test suite out of the PRODUCTION hook-fire log (ersatztv#776). Four suites here drive real hooks as subprocesses — `test_merge_consent_exemption.py`, `test_merge_consent_base_change.py`, `test_prepush_rebase_check_tag_exemption.py`, `test_pr_changed_files.py` — and they predate the instrumentation. Once every hook records its own execution, running `pytest scripts/tests` wrote its synthetic invocations into `$HOME/.cache/ersatztv/hook-fire/`: 96 `pretooluse-merge-consent` fires including two `deny`s, and 12 `blocked` decisions from `prepush-rebase-check`, none of them a real session. That is not untidiness, it is the defect the whole change exists to remove. `scripts/hook-fire-log.sh report` is meant to answer "what did the harness actually do", and a log carrying test artifacts answers a different question while looking identical — inference reintroduced one layer up. The record has no field distinguishing a test invocation from a real one, and adding one would only move the problem, so the fix is that tests never write to the real log at all. Autouse and session-independent: a new suite that drives a hook is isolated by existing, without having to know this file is here. """ from __future__ import annotations import pytest @pytest.fixture(autouse=True) def isolate_hook_fire_log(tmp_path_factory, monkeypatch): monkeypatch.setenv("ETV_HOOK_FIRE_LOG_DIR", str(tmp_path_factory.mktemp("hook-fire-log")))