litellm/tests/test_litellm/responses
ryan-crabbe-berri b76def0e5d
test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769)
`pytest.raises(Exception)` with no `match=` passes on any error that broad. A
TypeError from a refactor, a botched fixture, an import that moved: all of them
read as the rejection the test claims to police, so the test goes green for the
wrong reason and stays green after the behaviour it guards is gone.

PT011 closes that gap for the 317 sites B017 could not reach, because B017 only
fires on a single-statement body with no `as e` binding. Each pattern here is the
message the code actually raised, recorded by running the sites under a plugin
that logged the concrete type and text per call site, so the assertions describe
observed behaviour rather than a guess. Where a site raises more than one message
across its parametrize cases, the pattern is an alternation of what was seen;
where the exception carries an empty `str()` and puts the text on `.message`, the
site keeps a narrow `noqa` with the reason.

PT014 removes four parametrize cases that were listed twice. The duplicate re-runs
an assertion that already passed, and it usually marks a case someone meant to
vary and forgot to edit.
2026-08-20 20:24:49 -07:00
..
litellm_completion_transformation fix(usage): keep responses usage SDK-parseable and complete streamed reasoning splits 2026-08-19 14:57:19 -07:00
mcp Merge pull request #36978 from Scott-Wilson-ZocDoc/fix/mcp-guardrail-usage-monitor 2026-08-17 13:18:03 -07:00
test_custom_tool_call.py fix(responses-bridge): custom tool round-trip and allowlist preservation for Codex CLI (#32258) 2026-07-06 17:34:27 -07:00
test_metadata_codex_callback.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_no_duplicate_spend_logs.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_null_test_fix.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_responses_api_bridge_flag.py fix(responses): forward allowed_openai_params through the chat completions bridge (#35885) 2026-08-07 19:57:26 -07:00
test_responses_api_request_body.py Fall back to the GPT version rule when the cost map carries no breakpoint flag 2026-08-20 05:47:19 -07:00
test_responses_prompt_management.py fix(responses): handle non-message-only prompt input 2026-07-15 18:51:07 +00:00
test_responses_router_cooldown.py fix(responses): register cooldowns on failure + fail fast on stale encrypted_content (#27820) 2026-05-13 09:03:13 -07:00
test_responses_streaming_iterator.py fix(responses): stop scheduling sync success_handler concurrently with async_success_handler (#32239) 2026-07-07 09:13:50 -07:00
test_responses_utils.py Fall back to the GPT version rule when the cost map carries no breakpoint flag 2026-08-20 05:47:19 -07:00
test_responses_websocket_all_providers.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_rust_bridge_websocket.py feat(rust): 1:1 port of OpenAI Responses API WebSockets to litellm-rust (#33849) 2026-07-19 01:55:35 +00:00
test_sse_output_recovery.py Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
test_streaming_iterator.py fix(responses): end stream cleanly on transport error after terminal event 2026-07-15 08:33:50 -07:00
test_streaming_iterator_error_events.py test: enforce PT012 so a pytest.raises block cannot hide dead assertions (#37748) 2026-08-20 19:36:26 -07:00
test_text_format_conversion.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00