diff --git a/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py b/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py index c61c7401238..caf5bd7cfc5 100644 --- a/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py +++ b/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py @@ -951,6 +951,10 @@ async def test_patch_guardrail_endpoint( assert mock_guardrail_registry.update_guardrail_in_db.call_count == 2 # Verify rollback attempted in-memory re-sync with old config assert mock_in_memory_handler.sync_guardrail_from_db.call_count == 2 + elif scenario == "database_failure": + assert "Database error" in str(exc_info.value.detail) + elif scenario == "no_prisma_client": + assert "Prisma client not initialized" in str(exc_info.value.detail) else: result = await patch_guardrail( "test-guardrail-id", MOCK_PATCH_REQUEST, user_api_key_dict=MOCK_ADMIN_USER