mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
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:
parent
ed9c4a3fe9
commit
b67aa5daec
1 changed files with 4 additions and 2 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue