From 87a6237f89026285a9f348dfc6ed47786636d6bd Mon Sep 17 00:00:00 2001 From: basil-k-aji-dev <70605804+basil-k-aji-dev@users.noreply.github.com> Date: Mon, 14 Sep 2026 00:52:10 +0530 Subject: [PATCH] test(flash): build the turn-index runner without provider credentials `tests/unit/agents/flash/test_turn_index_snapshot.py` failed 4 of its 5 tests without GOOGLE_API_KEY. `FlashRunner.__init__` constructs a `VisualStepSummarizer`, whose constructor resolves a real model client and raises `ValidationError: API key required for Gemini Developer API`. The `_runner` helper already discards the summarizer with `runner.summarizer = None`, but that runs after construction has raised, so it never takes effect. Patch the class for the construction itself. These tests assert index resolution across a turn and never summarize anything, so nothing they cover is mocked away. Closes #31. --- tests/unit/agents/flash/test_turn_index_snapshot.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/unit/agents/flash/test_turn_index_snapshot.py b/tests/unit/agents/flash/test_turn_index_snapshot.py index 0c6e4227..b2a461e4 100644 --- a/tests/unit/agents/flash/test_turn_index_snapshot.py +++ b/tests/unit/agents/flash/test_turn_index_snapshot.py @@ -100,7 +100,15 @@ def mock_context(): def _runner(mock_context, observations): - with patch("artemis.controllers.unified_controller.get_driver"): + # FlashRunner.__init__ builds a VisualStepSummarizer, whose constructor + # resolves a real model client and raises without GOOGLE_API_KEY. Setting + # `runner.summarizer = None` below is too late -- the object is already + # built by then -- so the class is patched for the construction itself. + # These tests never summarize anything; they assert index resolution. + with ( + patch("artemis.controllers.unified_controller.get_driver"), + patch("artemis.agents.flash.runner.VisualStepSummarizer"), + ): runner = FlashRunner(mock_context, goal="Open Wi-Fi and Display") runner.summarizer = None runner.executor._session = _FakeSession(observations)