Files
litellm/tests/spend_tracking_tests
yuneng-jiang f351bbdb36 [Fix] Derive SPEND_PER_REQUEST dynamically in spend accuracy tests
Instead of hardcoding SPEND_PER_REQUEST (which broke when the model
changed from gpt-3.5-turbo-0301 to gpt-3.5-turbo), make a single
calibration request first, poll for its spend, and use that as the
per-request cost. Fails fast with pytest.fail() after 5 retries if
calibration cannot determine the cost.

Also fixes a bug in test_basic_spend_accuracy where the user spend
assertion error message referenced user_info['info'] instead of
user_info['user_info'].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 13:27:06 -07:00
..
2025-10-31 20:32:03 -07:00