From 510d40460960ff918b59d3b2ed2d7472d6008b1f Mon Sep 17 00:00:00 2001 From: Gyanu Mayank Date: Tue, 25 Aug 2026 22:03:24 +0530 Subject: [PATCH] Mark unpriced-settle test patches for TQ008 and ratchet TQ002. --- test-quality-budget.json | 2 +- .../hooks/test_proxy_track_cost_callback.py | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test-quality-budget.json b/test-quality-budget.json index 4a7bc7edff2..0350d813743 100644 --- a/test-quality-budget.json +++ b/test-quality-budget.json @@ -3,7 +3,7 @@ "limit": 744 }, "TQ002": { - "limit": 742 + "limit": 741 }, "TQ003": { "limit": 62 diff --git a/tests/test_litellm/proxy/hooks/test_proxy_track_cost_callback.py b/tests/test_litellm/proxy/hooks/test_proxy_track_cost_callback.py index fa080921a27..96b2bf15bb8 100644 --- a/tests/test_litellm/proxy/hooks/test_proxy_track_cost_callback.py +++ b/tests/test_litellm/proxy/hooks/test_proxy_track_cost_callback.py @@ -406,18 +406,18 @@ async def test_track_cost_callback_settles_budget_reservation_when_response_cost } with ( - patch( + patch( # test-quality-ok: callback reads proxy_logging_obj from the module; no injection seam "litellm.proxy.proxy_server.proxy_logging_obj", ) as mock_proxy_logging, - patch( + patch( # test-quality-ok: assert the hold is settled, not refunded through release_budget_reservation "litellm.proxy.spend_tracking.budget_reservation.release_budget_reservation", new_callable=AsyncMock, ) as mock_release_budget_reservation, - patch( + patch( # test-quality-ok: settle is a proxy-internal reservation call, not an HTTP boundary "litellm.proxy.spend_tracking.budget_reservation.reconcile_budget_reservation", new_callable=AsyncMock, ) as mock_reconcile_budget_reservation, - patch( + patch( # test-quality-ok: unpriced settle must not write a spend-log row "litellm.proxy.db.db_spend_update_writer.DBSpendUpdateWriter.update_database", new_callable=AsyncMock, ) as mock_update_database, @@ -468,18 +468,18 @@ async def test_track_cost_callback_settles_async_stream_when_response_cost_missi } with ( - patch( + patch( # test-quality-ok: callback reads proxy_logging_obj from the module; no injection seam "litellm.proxy.proxy_server.proxy_logging_obj", ) as mock_proxy_logging, - patch( + patch( # test-quality-ok: async-complete streams must settle, not release "litellm.proxy.spend_tracking.budget_reservation.release_budget_reservation", new_callable=AsyncMock, ) as mock_release_budget_reservation, - patch( + patch( # test-quality-ok: settle is a proxy-internal reservation call, not an HTTP boundary "litellm.proxy.spend_tracking.budget_reservation.reconcile_budget_reservation", new_callable=AsyncMock, ) as mock_reconcile_budget_reservation, - patch( + patch( # test-quality-ok: unpriced settle must not write a spend-log row "litellm.proxy.db.db_spend_update_writer.DBSpendUpdateWriter.update_database", new_callable=AsyncMock, ) as mock_update_database, @@ -528,23 +528,23 @@ async def test_track_cost_callback_invalidates_reservation_when_settle_fails(): } with ( - patch( + patch( # test-quality-ok: callback reads proxy_logging_obj from the module; no injection seam "litellm.proxy.proxy_server.proxy_logging_obj", ) as mock_proxy_logging, - patch( + patch( # test-quality-ok: a failed settle must not refund through release_budget_reservation "litellm.proxy.spend_tracking.budget_reservation.release_budget_reservation", new_callable=AsyncMock, ) as mock_release_budget_reservation, - patch( + patch( # test-quality-ok: force reconcile to fail so the invalidate path can be observed "litellm.proxy.spend_tracking.budget_reservation.reconcile_budget_reservation", new_callable=AsyncMock, side_effect=RuntimeError("redis down"), ), - patch( + patch( # test-quality-ok: invalidate is the only way to unpin counters after settle fails "litellm.proxy.spend_tracking.budget_reservation.invalidate_budget_reservation_counters", new_callable=AsyncMock, ) as mock_invalidate_budget_reservation_counters, - patch( + patch( # test-quality-ok: failed settle must not write a spend-log row "litellm.proxy.db.db_spend_update_writer.DBSpendUpdateWriter.update_database", new_callable=AsyncMock, ) as mock_update_database, @@ -583,7 +583,7 @@ async def test_track_cost_callback_releases_budget_reservation_for_non_model_cal "stream": False, } - with patch( + with patch( # test-quality-ok: health checks have no cost row; release is the observable contract "litellm.proxy.spend_tracking.budget_reservation.release_budget_reservation", new_callable=AsyncMock, ) as mock_release_budget_reservation: