litellm/tests/proxy_unit_tests
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
..
example_config_yaml
test_configs
test_model_response_typing
azure_fine_tune.jsonl
batch_job_results_furniture.jsonl
conftest.py
data_map.txt
eagle.wav
gettysburg.wav
large_text.py
messages_with_counts.py
model_cost.json
openai_batch_completions.jsonl
openai_batch_completions_router.jsonl
speech_vertex.mp3
test_aproxy_startup.py
test_audit_logs_proxy.py
test_auth_checks.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_banned_keyword_list.py
test_blog_posts_endpoint.py
test_check_batch_cost.py fix(proxy): claim batch cost rows atomically so multi-pod polling can't double-bill (#37685) 2026-08-20 16:21:04 -07:00
test_check_responses_cost.py fix(proxy): fall back to the SDK when a queued response's deployment is missing 2026-08-05 23:13:15 -07:00
test_custom_callback_input.py ci: lint the test tree for undefined names and fix all 30 (#37671) 2026-08-20 13:30:34 -07:00
test_custom_logger_s3_gcs.py chore(tests): thread config_file_path through s3/gcs custom-logger tests 2026-05-13 01:13:52 +00:00
test_custom_tokenizer_bug.py test: make custom_tokenizer proxy tests hermetic (#29643) 2026-06-04 12:51:37 -07:00
test_db_schema_changes.py
test_default_end_user_budget_simple.py Litellm oss staging 030626 (#29578) 2026-06-03 11:01:51 -07:00
test_deployed_proxy_keygen.py
test_deprecated_key_grace_period.py
test_e2e_pod_lock_manager.py
test_gemini_agents_endpoints.py Gemini managed agents support (#28270) 2026-05-19 16:02:03 -07:00
test_get_favicon.py
test_get_image.py
test_google_endpoint_routing.py
test_google_gemini_proxy_request.py
test_jwt.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_jwt_key_mapping.py feat(auth): resolve caller identity once into a Principal at the auth seam (#30887) 2026-06-20 18:49:41 -07:00
test_key_generate_dynamodb.py
test_key_generate_prisma.py
test_models_fallback_endpoint.py
test_multipart_bypass_repro.py fix: harden /key/update authorization checks (#27878) 2026-05-14 04:16:04 +00:00
test_prisma_client_backoff_retry.py
test_prompt_test_endpoint.py fix: harden /key/update authorization checks (#27878) 2026-05-14 04:16:04 +00:00
test_proxy_config_unit_test.py test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731) 2026-08-20 18:09:42 -07:00
test_proxy_custom_auth.py
test_proxy_custom_logger.py
test_proxy_encrypt_decrypt.py
test_proxy_exception_mapping.py
test_proxy_gunicorn.py
test_proxy_pass_user_config.py
test_proxy_reject_logging.py [internal copy of #29089] fix: duplicate claude code traces (#29311) 2026-05-29 22:23:24 -07:00
test_proxy_routes.py chore(ci): merge dev branch (#28801) 2026-05-25 13:44:49 -07:00
test_proxy_server.py test: enforce PT012 so a pytest.raises block cannot hide dead assertions (#37748) 2026-08-20 19:36:26 -07:00
test_proxy_server_keys.py
test_proxy_server_spend.py
test_proxy_setting_guardrails.py
test_proxy_token_counter.py
test_proxy_utils.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_realtime_cache.py feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
test_reducto_ocr_route.py Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
test_request_size_limit_middleware.py
test_response_polling_handler.py
test_response_polling_pre_call_checks.py
test_search_api_logging.py
test_server_root_path.py
test_skills_db.py test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731) 2026-08-20 18:09:42 -07:00
test_ui_path_detection.py
test_unit_test_max_model_budget_limiter.py feat(proxy): add key-level budget_fallbacks to reroute requests when a per-model budget is exceeded (#31783) 2026-07-03 12:20:12 -07:00
test_unit_test_proxy_hooks.py
test_update_daily_tag_spend.py perf(spend): write each daily spend batch in one upsert statement (#36448) 2026-08-10 17:06:00 -07:00
test_update_spend.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_user_api_key_auth.py test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731) 2026-08-20 18:09:42 -07:00
test_zero_cost_model_budget_bypass.py
vertex_key.json