The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test_e2e_generate_cold_storage_object_key_not_configured
Ishaan Jafff1c710a608d4
diff --git a/tests/test_litellm/litellm_core_utils/test_litellm_logging.py b/tests/test_litellm/litellm_core_utils/test_litellm_logging.pyindex 8fd73dbb79f..48a22dcc8af 100644--- a/tests/test_litellm/litellm_core_utils/test_litellm_logging.py+++ b/tests/test_litellm/litellm_core_utils/test_litellm_logging.py@@ -446,48 +446,24 @@ async def test_e2e_generate_cold_storage_object_key_not_configured():from datetime import datetime, timezonefrom unittest.mock import patch+ import litellmfrom litellm.litellm_core_utils.litellm_logging import StandardLoggingPayloadSetup# Create test datastart_time = datetime(2025, 1, 15, 10, 30, 45, 123456, timezone.utc)response_id = "chatcmpl-test-67890"team_alias = "another-team"-- with patch("litellm.configured_cold_storage_logger", return_value=None):-++ # Use patch to ensure test isolation+ with patch.object(litellm, 'configured_cold_storage_logger', None):# Call the functionresult = StandardLoggingPayloadSetup._generate_cold_storage_object_key(start_time=start_time,response_id=response_id,team_alias=team_alias)-- # Verify the result is None when cold storage is not configured- assert result is None---async def test_e2e_generate_cold_storage_object_key_runtime_error_handled():- """Ensure runtime errors while loading cold storage logger are ignored."""- from datetime import datetime, timezone- from unittest.mock import patch-- from litellm.litellm_core_utils.litellm_logging import StandardLoggingPayloadSetup++ # Verify the result is None when cold storage is not configured+ assert result is None- start_time = datetime(2025, 1, 15, 10, 30, 45, 123456, timezone.utc)- response_id = "chatcmpl-test-runtime"- team_alias = "team"- with patch(- "litellm.configured_cold_storage_logger",- side_effect=RuntimeError("can't register atexit after shutdown"),- ):- result = StandardLoggingPayloadSetup._generate_cold_storage_object_key(- start_time=start_time,- response_id=response_id,- team_alias=team_alias,- )-- # When an exception occurs retrieving the cold storage logger, the- # function should return None instead of raising.- assert result is None