Repository navigation
test: drop cost-map mirror tests - #41267
ryan-crabbe-berri wants to merge 1 commit into
Conversation
39 tests did nothing but restate values that already live in
model_prices_and_context_window.json: a literal price, token limit, rpm or
capability flag read straight back through model_cost[key] or
get_model_info("<the same key>"). The only way to break one is to edit the
JSON, which means each was just a second place you had to edit, and none of
them would catch a code regression.
Kept everything that exercises real code behind the registry: provider-prefix
and bedrock regional resolution, finetune-id stripping, ModelInfo field
hydration, fallbacks for unmapped models, and the billing math.
|
bugbot run |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummaryThis test-only PR removes cost-map assertions, constants, and one test file
Confidence Score: 4/5The runtime is unchanged, but the weakened regression coverage should be restored or replaced before merging to satisfy the repository requirement Most removals are harmless mirrors, but deleting independent Fireworks limit and GPT-5.6 alias-parity regressions permits known metadata failures to recur undetected Files Needing Attention: tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_kimi_model_metadata.py, tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py
|
| Filename | Overview |
|---|---|
| tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py | Removes direct pricing assertions, including an independent GPT-5.6 alias-to-Sol parity regression |
| tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_kimi_model_metadata.py | Deletes Fireworks Kimi limit coverage, leaving K2.5 without an equivalent exact output-limit assertion |
| tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py | Removes provider-wide cache-rate invariants while retaining representative cache billing tests |
| tests/test_litellm/router_utils/test_reasoning_effort_capability.py | Removes provider-matrix reasoning metadata assertions while retaining generic resolver and selected hydration coverage |
| tests/test_litellm/test_utils.py | Removes several model-info and cross-platform metadata regressions, with partial replacement coverage remaining |
| tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_cost.py | Removes a redundant model-info price assertion while retaining registry and end-to-end OCR billing tests |
Comments Outside Diff (1)
-
tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_kimi_model_metadata.pyDeleting these limit and pricing parity regressions can hide unsupported token limits or pricing drift, violating the coverage requirement; restore protection before merging
Rule Used: What: Flag any modifications to existing tests and verify they don't weaken test coverage or mask regressions. Why: Developers may alter tests to make failing code pass rather than fix the actual bug, hiding regressions. Good: ``` // Test updated t... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (1): Last reviewed commit: "test: drop cost-map mirror tests" | Re-trigger Greptile
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 96c02d5. Configure here.
Pull request was closed
TLDR
Problem this solves:
How it solves it:
User Flow
No user flow changes. This is a test-only PR: no runtime code, no config, and no registry values are touched, so nothing an end user sends or sees is different before and after
Relevant issues
Affected release
Linear ticket
Pre-Submission checklist
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
There is no live proxy surface here, so the proof is that every deleted assertion was already a copy of a value the repo ships. The check below reads
model_prices_and_context_window.jsonand prints what four of the deleted tests asserted next to what the registry actually carriesBefore (b97bc10)
OCR3_MODELismistral/mistral-ocr-2512andOCR3_COST_PER_PAGEis0.002, the same key and the same number the registry ships. The lookup name is the literal JSON key, so no resolution runs and there is no code between the file and the assert. The test directly above it in the same file already opens the JSON and asserts that field, so the deleted one was also a duplicatemodel_cost[key]orget_model_info("<that same key>")and asserts a literal it already containsAfter (96c02d5)
Type
🧹 Refactoring
✅ Test
Caveats
Low
Note
Low Risk
Deletes redundant tests only; production pricing and model metadata behavior are unchanged, with slightly less guard against silent JSON drift on removed pins.
Overview
Test-only cleanup: removes roughly 39 assertions (and one whole file) that only re-read
litellm.model_cost/get_model_infoand compare against literals already inmodel_prices_and_context_window.json.What goes away: launch-pricing pins (Gemini 3.x, Grok 4.6, Azure GPT-5.5/5.6, Baseten/Wandb/OpenRouter entries), alias parity checks (
gpt-5.6vs sol), reasoning-effort flag mirrors, Databricks cache-field sweeps, OCRget_model_infoduplicates, Fireworks Kimi max-output pins, Cloudflare RPM,gpt-image-2metadata, Anthropic re-exportprompt_cache_min_tokensmap scans, and similar.What stays: tests that still drive billing math (
generic_cost_per_token,completion_cost), routing/hydration behavior, JSON file reads where they’re the primary check, and parametrize blocks that assert computed costs—not static map copies.No runtime, config, or registry JSON changes in this diff.
Reviewed by Cursor Bugbot for commit 96c02d5. Bugbot is set up for automated code reviews on this repo. Configure here.