From 1a55418ea22d5414b60430d8947ba3b1ec089b34 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 21 Aug 2026 17:56:22 -0700 Subject: [PATCH] test(model-costs): use the local_model_cost_map fixture in the alias test The new test set LITELLM_LOCAL_MODEL_COST_MAP and reassigned litellm.model_cost by hand, leaking both into every test that ran after it and skipping the get_model_info cache clear. The conftest fixture already does this properly and restores the original map on the way out. --- .../llm_cost_calc/test_llm_cost_calc_utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py index 0e5a2c05fd1..940c6259070 100644 --- a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py +++ b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py @@ -965,14 +965,11 @@ def test_generic_cost_per_token_gpt56( assert round(completion_cost, 10) == round(output_cost * completion_tokens, 10) -def test_gpt_5_6_alias_prices_match_sol(): +def test_gpt_5_6_alias_prices_match_sol(local_model_cost_map): """Regression: the bare gpt-5.6 alias routes to GPT-5.6 Sol, so every cost field on the two entries has to hold the same value. They drifted once before, when Sol took its promotional cut and gpt-5.6 was left on the pre-cut rates, overbilling callers who used the alias.""" - os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" - litellm.model_cost = litellm.get_model_cost_map(url="") - alias = litellm.model_cost["gpt-5.6"] sol = litellm.model_cost["gpt-5.6-sol"]