litellm/tests/router_unit_tests
Harshit28j 9a4fd61e46 fix(ci): fix all remaining test failures for release
Anthropic structured output:
- Fix $ref resolution and additionalProperties for Anthropic output_format
- Fixes test_json_response_pydantic_obj, test_json_response_nested_*,
  test_tool_call_and_json_response_format, test_completion_thinking_with_response_format

Test fixes:
- test_validate_environment_raises_without_key: clear env vars with monkeypatch
- test_stream_chunk_builder_openai_audio_output_usage: fix exception handling
  and use resilient field-level assertions
- test_streamable_http_mcp_handler_mock: add missing auth context patches
- test_transcription_on_router: reset file position between API calls
- test_metadata_passed_to_custom_callback_codex_models: add try/finally cleanup
- Update test docstring to reference MidStreamFallbackError

Infrastructure:
- Sync proxy-extras schema.prisma with litellm/proxy/schema.prisma
- Switch Docker build_from_pip from Alpine to Debian slim (polars needs glibc)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:52:05 +05:30
..
conftest.py [Perf] Improvements for Async Success Handler (Logging Callbacks) - Approx +130 RPS (#13905) 2025-08-23 13:13:23 -07:00
create_mock_standard_logging_payload.py (refactor) - migrate router.deployment_callback_on_success to use StandardLoggingPayload (#7015) 2024-12-03 20:29:25 -08:00
gettysburg.wav test(router_code_coverage.py): check if all router functions are dire… (#6186) 2024-10-14 22:44:00 -07:00
README.md test(router_code_coverage.py): check if all router functions are dire… (#6186) 2024-10-14 22:44:00 -07:00
test_completion_no_copy.py [Perf] Alexsander fixes round 2 - Oct 18th (#15695) 2025-10-18 11:12:00 -07:00
test_default_deployment_copy.py [Perf] Alexsander fixes round 2 - Oct 18th (#15695) 2025-10-18 11:12:00 -07:00
test_get_model_list_alias_optimization.py fix(router): avoid alias scan for non-alias get_model_list lookups (#21136) 2026-02-16 20:40:24 -08:00
test_pre_call_checks_optimization.py [Perf] Alexsander fixes round 2 - Oct 18th (#15695) 2025-10-18 11:12:00 -07:00
test_prompt_management_check.py [Perf] Alexsander fixes round 2 - Oct 18th (#15695) 2025-10-18 11:12:00 -07:00
test_router_acancel_batch.py fix(test): add router.acancel_batch coverage (#20183) 2026-01-31 12:39:19 -08:00
test_router_adding_deployments.py Support env var vertex credentials for passthrough + ignore space id on watsonx deployment (throws Json validation errors) (#11527) 2025-06-07 20:31:05 -07:00
test_router_batch_utils.py fix(batch_utils.py): improve batch utils to handle newlines within batch content 2025-11-05 16:15:09 -08:00
test_router_cooldown_utils.py fix(router): add minimum request threshold for error rate cooldown (#17464) 2025-12-12 04:36:10 -08:00
test_router_embedding_headers.py 🐛 fix: propagate headers in router embedding calls (#18844) 2026-01-09 23:57:18 +05:30
test_router_embedding_integration.py 🐛 fix: propagate headers in router embedding calls (#18844) 2026-01-09 23:57:18 +05:30
test_router_endpoints.py fix(ci): fix all remaining test failures for release 2026-03-06 19:52:05 +05:30
test_router_handle_error.py fix(handle_error.py): add unit tests 2025-08-11 18:25:30 -07:00
test_router_helper_utils.py [Release Fix] (#22411) 2026-02-28 09:46:35 -08:00
test_router_index_management.py [Oct Staging Branch] (#15460) 2025-10-17 17:52:25 -07:00
test_router_prompt_caching.py Fix extract_cacheable_prefix to handle string content with message-level cache_control (fixes #19228) 2026-01-17 10:35:40 +05:30

Router component unit tests.

Please name all files with the word 'router' in them.

This is used to ensure all functions in the router are tested.