test: patch HardenedTCPConnector in proxy shared-session cleanup_closed tests

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
This commit is contained in:
Devin AI 2026-07-18 17:07:55 +00:00
parent ed9c4a3fe9
commit b67aa5daec

View file

@ -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())