Skip to content

test_turn_index_snapshot fails offline when GOOGLE_API_KEY is not set #31

Open

Description

@Fire162

Running tests/unit/agents/flash/test_turn_index_snapshot.py on an environment without GOOGLE_API_KEY fails 4 tests during _runner initialization:

$ uv run pytest tests/unit/agents/flash/test_turn_index_snapshot.py
E   pydantic_core._pydantic_core.ValidationError: 1 validation error for ChatGoogleGenerativeAI
E     Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable.

Cause

FlashRunner.__init__ instantiates VisualStepSummarizer, which attempts to construct ChatGoogleGenerativeAI without a mock. In _runner, runner.summarizer is immediately set to None, but VisualStepSummarizer is already invoked during FlashRunner(...) initialization.

Patching VisualStepSummarizer during _runner creation allows the suite to run offline and deterministically as intended.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions