From d19b37c97b7d5d89a759f1ca0a66b843cdf62bab Mon Sep 17 00:00:00 2001 From: yryzhan Date: Wed, 20 May 2026 17:49:10 +0200 Subject: [PATCH] test(proxy): assert shared callback is _ProxyDBLogger instance Adds isinstance check to verify the shared object is actually a _ProxyDBLogger, not just that two args share identity. --- tests/test_litellm/proxy/test_proxy_server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_litellm/proxy/test_proxy_server.py b/tests/test_litellm/proxy/test_proxy_server.py index 4d9a7e690f5..bb323359803 100644 --- a/tests/test_litellm/proxy/test_proxy_server.py +++ b/tests/test_litellm/proxy/test_proxy_server.py @@ -7501,10 +7501,13 @@ class TestCostTrackingSingleDBLogger: with patch("litellm.logging_callback_manager", mock_callback_manager): cost_tracking() + from litellm.proxy.hooks.proxy_track_cost_callback import _ProxyDBLogger + add_callback_call = mock_callback_manager.add_litellm_callback.call_args[0][0] add_async_call = ( mock_callback_manager.add_litellm_async_success_callback.call_args[0][0] ) + assert isinstance(add_callback_call, _ProxyDBLogger) assert add_callback_call is add_async_call def test_cost_tracking_noop_when_prisma_client_is_none(self):