litellm/tests/test_litellm/router_utils
abhi 6df125ff6d fix: address CI failures on canonical model resolution
Three CI gates failed on the initial push; all three were real:

1. lint (strict-rule budget): BLE001 +5, PERF401 +1 over base. The defensive
   'except Exception' catches are intentional (an unplaceable name or a
   malformed deployment must never fail a request or brick a router), so they
   now carry '# noqa: BLE001' with justifications, matching the convention
   already used in router.py and common_request_processing.py. The candidate
   -spelling loop becomes a generator passed to list.extend (PERF401).
   Both rules are now back at base parity.

2. code-quality (router_code_coverage): the checker only scans test files whose
   filename contains 'router', so tests/.../test_canonical_model_resolution.py
   was invisible to it and both new Router methods read as untested. Renamed to
   test_router_canonical_model_resolution.py and added direct coverage for
   _get_canonical_model_index (memoization + fenced build failure). Checker now
   reports untested_perc: 0.0.

3. proxy-infra (test_route_non_a2a_model_raises_error_if_not_in_router): a real
   regression. The test drives route_request with a Mock() router, so
   resolve_canonical_model_name returned a truthy Mock and the hook treated it
   as a resolved target instead of raising. Both hooks (routing and auth) now
   require an actual non-empty str before acting on a resolution -- correct
   hardening independent of the test: a stub or partially-initialised router
   must never be read as a grant.

Full affected suite: 517 passed. basedpyright: new module 0 errors.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 11:09:14 -07:00
..
pre_call_checks feat(router): independent, default-on deployment affinity for the auto-router (#36146) 2026-08-08 13:02:29 -07:00
test_add_retry_fallback_headers.py feat(router): add separate ITPM/OTPM deployment rate limits (#31952) 2026-07-05 21:58:35 +05:30
test_auto_router_model_naming.py feat(complexity_router): let operators rename the four complexity tiers (#35893) 2026-08-05 09:42:57 -07:00
test_cooldown_cache.py fix(router): cool down failed fallback deployments and correct cooldown TTL after Redis backfill (#35104) 2026-08-10 16:51:55 -07:00
test_cooldown_handlers.py feat(router): make routing groups callable as virtual models and list them in /v1/models (#36519) 2026-08-11 18:41:19 -07:00
test_fallback_event_handlers.py fix(router): cool down failed fallback deployments and correct cooldown TTL after Redis backfill (#35104) 2026-08-10 16:51:55 -07:00
test_health_check_allowed_fails_integration.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_health_state_cache.py feat(router): add health-check-driven routing behind opt-in flag 2026-03-27 20:57:08 +05:30
test_router_canonical_model_resolution.py fix: address CI failures on canonical model resolution 2026-08-15 11:09:14 -07:00
test_router_health_check_routing.py Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00
test_router_interactions_endpoints.py Gemini managed agents support (#28270) 2026-05-19 16:02:03 -07:00
test_router_utils_common_utils.py fix(router): warn when a deployment's credentials contradict its provider (#36486) 2026-08-10 18:41:19 -07:00