From f5cb5619d0608d33ac216494e5228353605b5a60 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 22 Aug 2026 00:31:47 +0000 Subject: [PATCH] refactor(tests): drop redundant comments in databricks pricing tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../llms/databricks/test_databricks_cost_calculator.py | 3 +-- .../llms/databricks/test_databricks_pricing.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py b/tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py index 2423b7ce68b..62058457b73 100644 --- a/tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py +++ b/tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py @@ -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() diff --git a/tests/test_litellm/llms/databricks/test_databricks_pricing.py b/tests/test_litellm/llms/databricks/test_databricks_pricing.py index df58e1c44c6..5d455ecfa93 100644 --- a/tests/test_litellm/llms/databricks/test_databricks_pricing.py +++ b/tests/test_litellm/llms/databricks/test_databricks_pricing.py @@ -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),