import os import pytest @pytest.fixture(autouse=True) def _no_live_steering(request): """config.json may have steering on; tests mock the one-shot path only, so a live `claude` process would otherwise be spawned for real. test_steering_dispatch.py exercises the config logic itself — leave it be. Plain os.environ, not monkeypatch: requesting monkeypatch here reorders teardown in test_steering_dispatch (registry reset sees the fake).""" if request.module.__name__.endswith("test_steering_dispatch"): yield return old = os.environ.get("ECHO_STEERING") os.environ["ECHO_STEERING"] = "off" yield if old is None: os.environ.pop("ECHO_STEERING", None) else: os.environ["ECHO_STEERING"] = old