From ca8f5cffa0051dfb9f607b4f4f7fe925312c9a18 Mon Sep 17 00:00:00 2001 From: voidborne-d Date: Tue, 17 Mar 2026 18:52:57 +0000 Subject: [PATCH] style: apply black formatting to fix CI lint check --- litellm/proxy/route_llm_request.py | 4 +++- .../proxy/test_aiohttp_session_recovery.py | 12 +++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/litellm/proxy/route_llm_request.py b/litellm/proxy/route_llm_request.py index 79e8f41972f..f1590b16c24 100644 --- a/litellm/proxy/route_llm_request.py +++ b/litellm/proxy/route_llm_request.py @@ -185,7 +185,9 @@ async def add_shared_session_to_data(data: dict) -> None: "SESSION REUSE: Shared aiohttp session is None after re-check, recreating..." ) try: - new_session = await proxy_server._initialize_shared_aiohttp_session() + new_session = ( + await proxy_server._initialize_shared_aiohttp_session() + ) except Exception: verbose_proxy_logger.exception( "SESSION REUSE: Exception during shared session recreation" diff --git a/tests/test_litellm/proxy/test_aiohttp_session_recovery.py b/tests/test_litellm/proxy/test_aiohttp_session_recovery.py index a2b09527962..f089d10425c 100644 --- a/tests/test_litellm/proxy/test_aiohttp_session_recovery.py +++ b/tests/test_litellm/proxy/test_aiohttp_session_recovery.py @@ -22,9 +22,7 @@ async def test_add_shared_session_attaches_open_session(): mock_session = MagicMock() mock_session.closed = False - with patch( - "litellm.proxy.proxy_server.shared_aiohttp_session", mock_session - ): + with patch("litellm.proxy.proxy_server.shared_aiohttp_session", mock_session): data = {} await add_shared_session_to_data(data) assert data["shared_session"] is mock_session @@ -129,9 +127,7 @@ async def test_add_shared_session_no_session_available(): """When no session was ever created, data should not contain shared_session.""" from litellm.proxy.route_llm_request import add_shared_session_to_data - with patch( - "litellm.proxy.proxy_server.shared_aiohttp_session", None - ): + with patch("litellm.proxy.proxy_server.shared_aiohttp_session", None): data = {} await add_shared_session_to_data(data) assert "shared_session" not in data @@ -175,9 +171,7 @@ async def test_add_shared_session_concurrent_recreation_uses_lock(): ): # Launch 5 concurrent calls results = [{} for _ in range(5)] - await asyncio.gather( - *(add_shared_session_to_data(d) for d in results) - ) + await asyncio.gather(*(add_shared_session_to_data(d) for d in results)) # Only 1 coroutine should have called _initialize (the rest see the # re-checked session as open under the lock)