test: reorder test_utils tail to keep the daily merge conflict-free (#33788)
Some checks failed
OSS Daily Guardrails / Run OSS daily safe checks (push) Has been cancelled

The daily OSS branch and litellm_internal_staging each appended an
independent test block at the very end of tests/test_litellm/test_utils.py,
so merging the two collides on that shared end-of-file position even though
the additions are unrelated (this branch adds the vertex embedding
encoding-format tests; staging adds the per-model prompt-cache-minimum
tests). Moving this branch's new TestVertexEmbeddingEncodingFormat class
above test_gemini_image_models_do_not_support_reasoning, which both branches
share, gives the two additions different anchors, so git applies both
without a conflict and without pulling staging into this branch. Pure
reorder; no test bodies change
This commit is contained in:
yuneng-jiang 2026-07-17 16:12:21 -07:00 committed by GitHub
parent 8c0910d4a4
commit 0fe54836f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4714,34 +4714,6 @@ class TestValidateEnvironmentTencent:
assert "TENCENT_API_KEY" in result["missing_keys"]
@pytest.mark.parametrize(
"model",
[
"vertex_ai/gemini-2.5-flash-image",
"vertex_ai/gemini-3-pro-image",
"vertex_ai/gemini-3-pro-image-preview",
"vertex_ai/gemini-3.1-flash-image",
"vertex_ai/gemini-3.1-flash-image-preview",
"gemini/gemini-2.5-flash-image",
"gemini/gemini-3-pro-image",
"gemini/gemini-3-pro-image-preview",
"gemini/gemini-3.1-flash-image",
"gemini/gemini-3.1-flash-image-preview",
],
)
def test_gemini_image_models_do_not_support_reasoning(
model: str, local_model_cost_map: None
) -> None:
assert model in litellm.model_cost, (
f"{model} is missing from the local model cost map. "
"Add its entry to litellm/model_prices_and_context_window_backup.json."
)
assert litellm.supports_reasoning(model) is False, (
f"{model} incorrectly classified as reasoning-capable. "
"Add 'supports_reasoning: false' to its model_cost entry."
)
class TestVertexEmbeddingEncodingFormat:
"""vertex_ai/gemini embeddings must accept encoding_format="float" — it's
the OpenAI SDK default and float lists are exactly what the vertex API
@ -4790,3 +4762,31 @@ class TestVertexEmbeddingEncodingFormat:
custom_llm_provider="vertex_ai",
)
assert optional_params.get("outputDimensionality") == 256
@pytest.mark.parametrize(
"model",
[
"vertex_ai/gemini-2.5-flash-image",
"vertex_ai/gemini-3-pro-image",
"vertex_ai/gemini-3-pro-image-preview",
"vertex_ai/gemini-3.1-flash-image",
"vertex_ai/gemini-3.1-flash-image-preview",
"gemini/gemini-2.5-flash-image",
"gemini/gemini-3-pro-image",
"gemini/gemini-3-pro-image-preview",
"gemini/gemini-3.1-flash-image",
"gemini/gemini-3.1-flash-image-preview",
],
)
def test_gemini_image_models_do_not_support_reasoning(
model: str, local_model_cost_map: None
) -> None:
assert model in litellm.model_cost, (
f"{model} is missing from the local model cost map. "
"Add its entry to litellm/model_prices_and_context_window_backup.json."
)
assert litellm.supports_reasoning(model) is False, (
f"{model} incorrectly classified as reasoning-capable. "
"Add 'supports_reasoning: false' to its model_cost entry."
)