From c652c0dfecb3bbc8b80c219a7e3f7b41812c8441 Mon Sep 17 00:00:00 2001 From: Anirudh Dharmarajan Date: Thu, 17 Sep 2026 22:48:43 -0600 Subject: [PATCH] test: configure prompt storage without mocking internals --- .../proxy/spend_tracking/test_spend_tracking_utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py b/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py index 0821163fd40..5ffd2e6805e 100644 --- a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py +++ b/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py @@ -2421,15 +2421,15 @@ def test_proxy_server_request_payload_excludes_secret_fields(mock_should_store): @pytest.mark.asyncio @pytest.mark.parametrize("redact", [False, True], ids=["stored", "redacted"]) -@patch( - "litellm.proxy.spend_tracking.spend_tracking_utils.should_store_prompts_and_responses_in_spend_logs", - return_value=True, -) -async def test_websocket_snapshot_spend_serialization_preserves_transport(_mock_should_store, redact): +async def test_websocket_snapshot_spend_serialization_preserves_transport( + monkeypatch: pytest.MonkeyPatch, redact: bool +) -> None: from starlette.websockets import WebSocket from litellm.proxy.litellm_pre_call_utils import refresh_proxy_server_request_body_snapshot + monkeypatch.setenv("STORE_PROMPTS_IN_SPEND_LOGS", "true") + class AppTraversalTrap: @property def __dict__(self):