Skip to content

Commit

Permalink
Ignore test when google.genai not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Feb 24, 2025
1 parent 1170207 commit c409a20
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,15 @@ def empty(m: list[ModelMessage], _info: AgentInfo) -> ModelResponse:
)


try:
import google.genai # type: ignore # noqa

skip_gemini_test = False
except ImportError:
skip_gemini_test = True


@pytest.mark.skipif(skip_gemini_test, reason='Need google-genai installed.')
def test_model_requests_blocked(env: TestEnv):
env.set('GEMINI_API_KEY', 'foobar')
agent = Agent('google-gla:gemini-1.5-flash', result_type=tuple[str, str], defer_model_check=True)
Expand Down

0 comments on commit c409a20

Please sign in to comment.