diff --git a/tests/llm_translation/test_mistral_api.py b/tests/llm_translation/test_mistral_api.py index fd1dfb29315..6d7faceeb5d 100644 --- a/tests/llm_translation/test_mistral_api.py +++ b/tests/llm_translation/test_mistral_api.py @@ -36,18 +36,8 @@ class TestMistralCompletion(BaseLLMChatTest): """Web search is routed to the Conversations API for models that support it""" from litellm.utils import supports_web_search - if not os.getenv("MISTRAL_API_KEY"): - pytest.skip("MISTRAL_API_KEY not set") - - os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" - litellm.model_cost = litellm.get_model_cost_map(url="") - - litellm._turn_on_debug() - model = "mistral/mistral-medium-latest" - - if not supports_web_search(model, None): - pytest.skip("Model does not support web search") + assert supports_web_search(model, None) response = litellm.completion( model=model, @@ -56,15 +46,12 @@ class TestMistralCompletion(BaseLLMChatTest): max_tokens=100, ) - assert response is not None + assert response.choices[0].message.content def test_web_search_with_tool_call_history(self): """The Conversations API accepts prior function-call history mapped to function.call / function.result input entries alongside a web search request (a 400 here means the mapped wire schema is wrong).""" - if not os.getenv("MISTRAL_API_KEY"): - pytest.skip("MISTRAL_API_KEY not set") - response = litellm.completion( model="mistral/mistral-medium-latest", messages=[ @@ -87,16 +74,12 @@ class TestMistralCompletion(BaseLLMChatTest): max_tokens=200, ) - assert response is not None assert response.choices[0].message.content def test_web_search_truncation_reports_length(self): """The Conversations API returns no finish reason, so truncation is inferred from the token budget. Force a real truncation (max_tokens=1 with an overflowing prompt) and assert the response reports finish_reason='length'.""" - if not os.getenv("MISTRAL_API_KEY"): - pytest.skip("MISTRAL_API_KEY not set") - response = litellm.completion( model="mistral/mistral-medium-latest", messages=[