litellm/tests/test_litellm/proxy/spend_tracking
ryan-crabbe-berri 21e9632713
test: add six ruff rules that catch tests which cannot fail (#37709)
`assert False` inside a `try:` raises AssertionError, which the `except
Exception` right below it catches, so several tests reported green no matter
what the code did. `pytest.fail` raises Failed, a BaseException, and escapes.

A bare `a == b` statement is evaluated and discarded. Nine of those sat in
tests, and one was comparing against a model name the router never produces.

Selects B011, B015, B018, PT015, PLR0133 and PLW0127 in ruff-tests.toml
alongside F821, with all 50 existing violations fixed, so no budget file or
ratchet is needed. CI already runs this config over tests/.
2026-08-20 14:21:26 -07:00
..
test_budget_reservation_redis_failure.py fix(register_model): preserve built-in cache pricing when registering custom overrides under unmapped keys (#30044) 2026-06-10 12:11:03 -07:00
test_cloudzero_endpoints.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_compression_savings.py feat(spend): track prompt compression saved tokens in daily spend aggregates (#33810) 2026-07-18 17:47:54 -07:00
test_ptu_feature_flag.py feat(ptu): gate PTU flat-cost attribution behind an opt-in env var (#36138) 2026-08-10 12:23:20 -07:00
test_ptu_flat_cost_rollup.py fix(ptu): hand the prune a plain delete filter the query builder can serialise (#37571) 2026-08-19 22:18:58 -07:00
test_savings.py fix(vertex_ai): apply regional endpoint uplift to cost tracking 2026-08-19 15:21:06 -07:00
test_spend_log_error_logger.py feat(spend-logs): opt-in suppression of stack traces in spend-tracking error logs 2026-05-02 00:44:34 +00:00
test_spend_management_endpoints.py test: add six ruff rules that catch tests which cannot fail (#37709) 2026-08-20 14:21:26 -07:00
test_spend_query_optimization.py fix(spend): bound the logs-tab pagination count to stop full-window scans (#31825) 2026-07-07 09:41:20 -07:00
test_spend_tracking_utils.py fix(proxy): populate deployment fields on failed-request spend logs from the standard logging payload 2026-08-19 14:25:43 -07:00