mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
test(pricing): force the local cost map when asserting gpt-realtime-mini mode
test_get_model_info_reports_realtime_mode called get_model_info, which by default fetches model_prices_and_context_window.json from GitHub's main branch. The mode=realtime change from #33728 lives on the internal staging branch but has not landed on main yet, so CI fetched the stale 'chat' mode and the assertion flipped, breaking the Unit Tests: MCP, Secrets, Containers & Misc job on every open PR. Point the assertion at the bundled backup JSON by forcing the local cost map flag on and rebinding model_cost, matching the pattern used by the realtime transcription tests in test_cost_calculator.py. Clear the get_model_info lru_cache so a prior remote-backed call in the same worker can not leak through. Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
parent
7015bd2ea1
commit
a8e243e07e
1 changed files with 4 additions and 1 deletions
|
|
@ -68,7 +68,10 @@ def test_realtime_only_gpt_4o_models_are_mode_realtime(model):
|
|||
assert _load_cost_map()[model]["mode"] == "realtime"
|
||||
|
||||
|
||||
def test_get_model_info_reports_realtime_mode():
|
||||
def test_get_model_info_reports_realtime_mode(monkeypatch):
|
||||
monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True") # pragma: allowlist secret
|
||||
monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))
|
||||
litellm.get_model_info.cache_clear()
|
||||
assert litellm.get_model_info("gpt-realtime-mini")["mode"] == "realtime"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue