Skip to content

Commit bc032a3

Browse files
authored
Fix tests skipping for Google AI integration (#788)
1 parent 48422b1 commit bc032a3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

integrations/google_ai/tests/generators/chat/test_chat_gemini.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def test_from_dict(monkeypatch):
188188
assert isinstance(gemini._model, GenerativeModel)
189189

190190

191-
@pytest.mark.skipif("GOOGLE_API_KEY" not in os.environ, reason="GOOGLE_API_KEY not set")
191+
@pytest.mark.skipif(not os.environ.get("GOOGLE_API_KEY", None), reason="GOOGLE_API_KEY env var not set")
192192
def test_run():
193193
# We're ignoring the unused function argument check since we must have that argument for the test
194194
# to run successfully, but we don't actually use it.
@@ -227,7 +227,7 @@ def get_current_weather(location: str, unit: str = "celsius"): # noqa: ARG001
227227
assert len(res["replies"]) > 0
228228

229229

230-
@pytest.mark.skipif("GOOGLE_API_KEY" not in os.environ, reason="GOOGLE_API_KEY not set")
230+
@pytest.mark.skipif(not os.environ.get("GOOGLE_API_KEY", None), reason="GOOGLE_API_KEY env var not set")
231231
def test_past_conversation():
232232
gemini_chat = GoogleAIGeminiChatGenerator(model="gemini-pro")
233233
messages = [

integrations/google_ai/tests/generators/test_gemini.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_from_dict(monkeypatch):
184184
assert isinstance(gemini._model, GenerativeModel)
185185

186186

187-
@pytest.mark.skipif("GOOGLE_API_KEY" not in os.environ, reason="GOOGLE_API_KEY not set")
187+
@pytest.mark.skipif(not os.environ.get("GOOGLE_API_KEY", None), reason="GOOGLE_API_KEY env var not set")
188188
def test_run():
189189
gemini = GoogleAIGeminiGenerator(model="gemini-pro")
190190
res = gemini.run("Tell me something cool")

0 commit comments

Comments
 (0)