litellm/tests/test_litellm/llms/azure
ryan-crabbe-berri 680bcfd8aa
test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731)
* test(lint): ban blind pytest.raises(Exception) with ruff B017

A bare pytest.raises(Exception) accepts whatever the body throws. The TypeError
a refactor introduces satisfies it exactly as well as the rejection the test was
written for, so the crash reads as a pass and the test never goes red.

All 111 existing sites are narrowed here. A runtime probe recorded the concrete
exception each one actually catches, and each site now names that type. Where
the code under test genuinely raises a bare Exception, the site pins a stable
slice of the message with match= instead.

Two sites tell on themselves. The shared responses-API cancel test raises
"custom_llm_provider is required but passed as None" rather than talking to a
provider at all, because cancel_responses takes a provider, not a model. And
test_bedrock_guardrails_with_streaming was the only test in its file still
passing without AWS credentials, because the NoCredentialsError boto3 raised
long before the guardrail ran satisfied the blind raises.

* fix(test): widen the openai batch-dispatch assertion to OpenAIError

The narrowed NotFoundError only holds where OPENAI_API_KEY is set. Without one
the SDK raises OpenAIError while building the client, long before any 404, so CI
went red. OpenAIError covers both and still rejects a TypeError from a refactor.
2026-08-20 18:09:42 -07:00
..
batches test(batches): add 1:1 test file scaffold for batches component paths (#30529) 2026-06-29 09:22:58 +05:30
chat fix(azure): rename max_tokens to max_completion_tokens for gpt-5-chat deployments (#36857) 2026-08-17 11:27:55 -07:00
image_edit Litellm oss staging 040626 (#29671) 2026-06-04 11:07:20 -07:00
image_generation feat(azure_ai): add MAI-Image-2.5 image generation support (#29688) 2026-06-08 18:27:04 -07:00
passthrough fix(azure/passthrough): populate standard_logging_object via logging hook 2026-04-14 08:10:39 +02:00
realtime feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
response fix(azure): build responses input_items url with path before query string (#32270) 2026-07-06 14:02:44 -07:00
text_to_speech style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
videos test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731) 2026-08-20 18:09:42 -07:00
test_azure_common_utils.py test: remove tests that never execute 2026-08-12 10:45:38 -07:00
test_azure_cost_calculation.py fix(cost): pass service_tier through azure and azure_ai cost calculation (#24926) 2026-05-01 17:26:45 +05:30
test_azure_embedding.py test: run the 30 test files stranded in the second mirror (#37595) 2026-08-20 10:59:43 -07:00
test_azure_exception_mapping.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_azure_fine_tuning_api.py refactor: refactor testing 2026-03-28 18:39:32 -07:00
test_azure_speech_audio_transcription.py feat(azure): add speech transcription config support (#27482) 2026-05-23 12:16:01 -07:00