From 02f6b5b5ec4b58503185a1ac8d9aec265f4fe884 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 28 Aug 2026 12:45:46 -0700 Subject: [PATCH] test(aiohttp): pin NO_PROXY so proxy env cannot hijack the refused-port probe --- tests/litellm_utils_tests/test_aiohttp_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/litellm_utils_tests/test_aiohttp_handler.py b/tests/litellm_utils_tests/test_aiohttp_handler.py index bd1e34ddb2f..3318cc1aef8 100644 --- a/tests/litellm_utils_tests/test_aiohttp_handler.py +++ b/tests/litellm_utils_tests/test_aiohttp_handler.py @@ -49,7 +49,10 @@ async def test_event_loop_robustness() -> None: @pytest.mark.parametrize(("ssl_verify", "expected_ssl"), [(False, False), (None, True)]) -async def test_refused_connection_maps_to_httpx_connect_error(ssl_verify: bool | None, expected_ssl: bool) -> None: +async def test_refused_connection_maps_to_httpx_connect_error( + ssl_verify: bool | None, expected_ssl: bool, monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.setenv("NO_PROXY", "127.0.0.1") transport: Final = AsyncHTTPHandler._create_aiohttp_transport(ssl_verify=ssl_verify) port: Final = _closed_local_port() request: Final = httpx.Request("GET", f"https://127.0.0.1:{port}/")