From d21e58bc6cc35b2478af50ce86b9500b3a9f2709 Mon Sep 17 00:00:00 2001 From: Sean Turner Date: Fri, 23 Oct 2026 17:15:55 +0100 Subject: [PATCH] test(runner): give the mock settings a telemetry namespace The runner now reads settings.telemetry.run_record_timings (core/runner.py, config/models.py), but the test_runner_* helpers build a SimpleNamespace settings mock without a telemetry attribute, so 18 tests fail with AttributeError on main. Add telemetry=SimpleNamespace(run_record_timings=False) to each mock. Co-Authored-By: Claude Opus 4.8 --- tests/test_runner_interrupt.py | 1 + tests/test_runner_mcp.py | 1 + tests/test_runner_rate_limit.py | 1 + tests/test_runner_root_prompt.py | 1 + tests/test_runner_teardown.py | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/test_runner_interrupt.py b/tests/test_runner_interrupt.py index b6271407b..bd93a10bf 100644 --- a/tests/test_runner_interrupt.py +++ b/tests/test_runner_interrupt.py @@ -31,6 +31,7 @@ def _wire_runner(monkeypatch: pytest.MonkeyPatch, tmp_path: Any) -> None: extra_body=None, ), runtime=types.SimpleNamespace(max_context_images=3), + telemetry=types.SimpleNamespace(run_record_timings=False), ) monkeypatch.setattr(runner, "load_settings", lambda: settings) monkeypatch.setattr(runner, "configure_sdk_model_defaults", lambda _settings: None) diff --git a/tests/test_runner_mcp.py b/tests/test_runner_mcp.py index 74f73c36b..d2e3821f2 100644 --- a/tests/test_runner_mcp.py +++ b/tests/test_runner_mcp.py @@ -47,6 +47,7 @@ def _settings() -> Any: extra_body=None, ), runtime=types.SimpleNamespace(max_context_images=3), + telemetry=types.SimpleNamespace(run_record_timings=False), ) diff --git a/tests/test_runner_rate_limit.py b/tests/test_runner_rate_limit.py index d6bad9aef..391906bb8 100644 --- a/tests/test_runner_rate_limit.py +++ b/tests/test_runner_rate_limit.py @@ -45,6 +45,7 @@ async def test_persistent_rate_limit_stops_gracefully( extra_body=None, ), runtime=types.SimpleNamespace(max_context_images=3), + telemetry=types.SimpleNamespace(run_record_timings=False), ) monkeypatch.setattr(runner, "load_settings", lambda: settings) monkeypatch.setattr(runner, "configure_sdk_model_defaults", lambda _settings: None) diff --git a/tests/test_runner_root_prompt.py b/tests/test_runner_root_prompt.py index 8c2e2047c..39c291573 100644 --- a/tests/test_runner_root_prompt.py +++ b/tests/test_runner_root_prompt.py @@ -67,6 +67,7 @@ def _patch_engine_scaffold( extra_body=None, ), runtime=types.SimpleNamespace(max_context_images=3), + telemetry=types.SimpleNamespace(run_record_timings=False), ) monkeypatch.setattr(runner, "load_settings", lambda: settings) monkeypatch.setattr(runner, "configure_sdk_model_defaults", lambda _settings: None) diff --git a/tests/test_runner_teardown.py b/tests/test_runner_teardown.py index e3c436960..7a714e737 100644 --- a/tests/test_runner_teardown.py +++ b/tests/test_runner_teardown.py @@ -55,6 +55,7 @@ def _settings() -> Any: extra_body=None, ), runtime=types.SimpleNamespace(max_context_images=3), + telemetry=types.SimpleNamespace(run_record_timings=False), )