The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test_completion_azure
Ishaan Jaffer5077e36f1bdb
diff --git a/tests/llm_translation/test_azure_ai.py b/tests/llm_translation/test_azure_ai.pyindex 943020c1bb3..241238cd221 100644--- a/tests/llm_translation/test_azure_ai.py+++ b/tests/llm_translation/test_azure_ai.py@@ -313,3 +313,29 @@ async def test_azure_gpt5_reasoning(model):)print("response: ", response)assert response.choices[0].message.content is not None++++def test_completion_azure():+ try:+ litellm.set_verbose = False+ ## Test azure call+ response = completion(+ model="azure/gpt-4.1-nano",+ messages=[+ {+ "role": "user",+ "content": "Hello, how are you?",+ }+ ],+ api_key="os.environ/AZURE_API_KEY",+ )+ print(f"response: {response}")+ print(f"response hidden params: {response._hidden_params}")+ print(response)++ cost = completion_cost(completion_response=response)+ assert cost > 0.0+ print("Cost for azure completion request", cost)+ except Exception as e:+ pytest.fail(f"Error occurred: {e}")diff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.pyindex b18a80da215..57e96f5fed2 100644--- a/tests/local_testing/test_completion.py+++ b/tests/local_testing/test_completion.py@@ -2581,37 +2581,6 @@ def test_re_use_openaiClient():pytest.fail("got Exception", e)-def test_completion_azure():- try:- litellm.set_verbose = False- ## Test azure call- response = completion(- model="azure/gpt-4o-new-test",- messages=messages,- api_key="os.environ/AZURE_API_KEY",- )- print(f"response: {response}")- print(f"response hidden params: {response._hidden_params}")- ## Test azure flag for backwards-compat- # response = completion(- # model="chatgpt-v-3",- # messages=messages,- # azure=True,- # max_tokens=10- # )- # Add any assertions here to check the response- print(response)-- cost = completion_cost(completion_response=response)- assert cost > 0.0- print("Cost for azure completion request", cost)- except Exception as e:- pytest.fail(f"Error occurred: {e}")---# test_completion_azure()--@pytest.mark.skip(reason="this is bad test. It doesn't actually fail if the token is not set in the header. ")