From 2fa9958e39256df053136f9a27dc702fb6a5ec38 Mon Sep 17 00:00:00 2001 From: Tin Chi Lo Date: Sat, 22 Aug 2026 07:56:21 -0400 Subject: [PATCH] test(complexity-router): vary only simple_medium in the override-floor test The ascending-boundary check means simple_medium can no longer be moved on its own past the filled default under it. Carrying the fixture's other two boundaries through, rather than restating a bespoke set, keeps simple_medium the single variable the test is named for and drops two numbers a reader would have had to reverse engineer. --- .../router_strategy/test_complexity_router.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/test_litellm/router_strategy/test_complexity_router.py b/tests/test_litellm/router_strategy/test_complexity_router.py index 16545be5491..1a73b31b9d4 100644 --- a/tests/test_litellm/router_strategy/test_complexity_router.py +++ b/tests/test_litellm/router_strategy/test_complexity_router.py @@ -297,22 +297,25 @@ class TestReasoningMarkerScoring: assert tier == ComplexityTier.REASONING def test_floor_defaults_to_simple_medium_and_follows_it(self, mock_router_instance, basic_config): - """Unset tracks simple_medium, so moving that boundary moves the floor with it.""" + """Unset tracks simple_medium, so moving that boundary moves the floor with it. + + Both arms carry the fixture's other two boundaries unchanged: simple_medium is the only + variable, and boundaries must ascend, so the pair above it cannot be left to fill from + shipped defaults that sit below the value under test. + """ prompt = ( "Give me the pros and cons, step by step, of moving our checkout service to an event-driven architecture." ) + boundaries = basic_config["tier_boundaries"] low = ComplexityRouter( model_name="test-complexity-router", litellm_router_instance=mock_router_instance, - complexity_router_config={**basic_config, "tier_boundaries": {"simple_medium": 0.20}}, + complexity_router_config={**basic_config, "tier_boundaries": {**boundaries, "simple_medium": 0.20}}, ) high = ComplexityRouter( model_name="test-complexity-router", litellm_router_instance=mock_router_instance, - complexity_router_config={ - **basic_config, - "tier_boundaries": {"simple_medium": 0.30, "medium_complex": 0.35, "complex_reasoning": 0.50}, - }, + complexity_router_config={**basic_config, "tier_boundaries": {**boundaries, "simple_medium": 0.30}}, ) assert low._effective_reasoning_override_min_score() == 0.20 assert high._effective_reasoning_override_min_score() == 0.30