refactor(tests): drop redundant comments in databricks pricing tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Devin AI 2026-08-22 00:31:47 +00:00
parent 90f9c07305
commit f5cb5619d0
2 changed files with 5 additions and 6 deletions

View file

@ -9,8 +9,7 @@ from litellm.types.utils import Usage
@pytest.fixture
def local_model_cost_map(monkeypatch):
"""Force get_model_info to resolve against the in-repo cost map instead of the
remote one fetched at import time, which still carries the pre-merge pricing."""
"""Resolve model info against the in-repo cost map, not the remote pre-merge one"""
monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")
monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))
litellm.get_model_info.cache_clear()

View file

@ -3,9 +3,9 @@ import os
from types import MappingProxyType
from typing import Final
# (cache write, cache read) multipliers on the input rate, per model vendor, from
# https://www.databricks.com/product/pricing/proprietary-foundation-model-serving
CACHE_RATIOS: Final = MappingProxyType({"claude": (1.25, 0.1), "gemini": (1.0, 0.1), "gpt-5": (1.0, 0.1)})
CACHE_WRITE_AND_READ_RATIOS_ON_INPUT_RATE: Final = MappingProxyType(
{"claude": (1.25, 0.1), "gemini": (1.0, 0.1), "gpt-5": (1.0, 0.1)}
)
def _load_cost_map() -> dict:
@ -80,7 +80,7 @@ def test_databricks_proprietary_models_have_cache_pricing():
if vendor is None or info.get("mode") != "chat":
continue
priced.append(model)
write_ratio, read_ratio = CACHE_RATIOS[vendor]
write_ratio, read_ratio = CACHE_WRITE_AND_READ_RATIOS_ON_INPUT_RATE[vendor]
input_usd = info["input_cost_per_token"]
for field, ratio in (
("cache_creation_input_token_cost", write_ratio),