From b67aa5daec884f6b315eee26afb883781c0d6da9 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:07:55 +0000 Subject: [PATCH] test: patch HardenedTCPConnector in proxy shared-session cleanup_closed tests Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> --- tests/test_litellm/proxy/test_aiohttp_cleanup_closed.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/proxy/test_aiohttp_cleanup_closed.py b/tests/test_litellm/proxy/test_aiohttp_cleanup_closed.py index c9b4d6475ab..dc0b8e9366e 100644 --- a/tests/test_litellm/proxy/test_aiohttp_cleanup_closed.py +++ b/tests/test_litellm/proxy/test_aiohttp_cleanup_closed.py @@ -12,7 +12,8 @@ def test_initialize_shared_aiohttp_session_sets_enable_cleanup_closed_when_neede monkeypatch.setattr(proxy_server_module, "AIOHTTP_NEEDS_CLEANUP_CLOSED", True) with patch( - "aiohttp.TCPConnector", return_value=connector_mock + "litellm.llms.custom_httpx.aiohttp_connector.HardenedTCPConnector", + return_value=connector_mock, ) as mock_tcp_connector: with patch("aiohttp.ClientSession", return_value=session_mock): asyncio.run(proxy_server_module._initialize_shared_aiohttp_session()) @@ -30,7 +31,8 @@ def test_initialize_shared_aiohttp_session_omits_enable_cleanup_closed_when_not_ monkeypatch.setattr(proxy_server_module, "AIOHTTP_NEEDS_CLEANUP_CLOSED", False) with patch( - "aiohttp.TCPConnector", return_value=connector_mock + "litellm.llms.custom_httpx.aiohttp_connector.HardenedTCPConnector", + return_value=connector_mock, ) as mock_tcp_connector: with patch("aiohttp.ClientSession", return_value=session_mock): asyncio.run(proxy_server_module._initialize_shared_aiohttp_session())