test: configure prompt storage without mocking internals

This commit is contained in:
Anirudh Dharmarajan 2026-09-17 22:48:43 -06:00
parent 13ea8be031
commit c652c0dfec
No known key found for this signature in database
GPG key ID: 1E74D51F530702D8

View file

@ -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):