Skip to content

Commit 6618db2

Browse files
authored
fix(tests): embeddings and chat_models test fixes (#1035)
- Image tests are very hit or miss - temporarily xfail while investigating a more reliable way to get expected output - Mark embed test with asyncio to satisfy event loop requirement
1 parent dc6b6c9 commit 6618db2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

libs/genai/tests/integration_tests/test_chat_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def test_chat_google_genai_invoke() -> None:
125125
_check_usage_metadata(result)
126126

127127

128+
@pytest.mark.xfail(reason=("investigate"))
128129
@pytest.mark.flaky(retries=3, delay=1)
129130
def test_chat_google_genai_invoke_with_image() -> None:
130131
"""Test invoke tokens with image from ChatGoogleGenerativeAI."""
@@ -376,6 +377,7 @@ def test_chat_google_genai_invoke_no_image_generation_without_modalities() -> No
376377
_check_usage_metadata(result)
377378

378379

380+
@pytest.mark.xfail(reason=("investigate"))
379381
@pytest.mark.flaky(retries=3, delay=1)
380382
def test_chat_google_genai_invoke_image_generation_with_modalities_merge() -> None:
381383
"""Test invoke tokens with image from ChatGoogleGenerativeAI with response

libs/genai/tests/integration_tests/test_embeddings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
" model against the pickle rick?",
1818
],
1919
)
20+
@pytest.mark.asyncio
2021
def test_embed_query_different_lengths(query: str) -> None:
2122
"""Test embedding queries of different lengths."""
2223
model = GoogleGenerativeAIEmbeddings(model=_MODEL)
24+
# Note: embed_query() is a sync method, but initialization needs the loop
2325
result = model.embed_query(query, output_dimensionality=_OUTPUT_DIMENSIONALITY)
2426
assert len(result) == 768
2527
assert isinstance(result, list)

0 commit comments

Comments
 (0)