@@ -186,11 +186,17 @@ async def test_http_proxy(
186186 method = b"GET"
187187 url = (b"http" , b"example.org" , 80 , b"/" )
188188 headers = [(b"host" , b"example.org" )]
189+ max_connections = 1
190+ max_keepalive = 2
189191 # Tunnel requires the host header to be present,
190192 # Forwarding will use the request headers
191193 proxy_headers = headers if proxy_mode == "TUNNEL_ONLY" else None
192194 async with httpcore .AsyncHTTPProxy (
193- proxy_server , proxy_headers = proxy_headers , proxy_mode = proxy_mode
195+ proxy_server ,
196+ proxy_headers = proxy_headers ,
197+ proxy_mode = proxy_mode ,
198+ max_connections = max_connections ,
199+ max_keepalive = max_keepalive ,
194200 ) as http :
195201 http_version , status_code , reason , headers , stream = await http .request (
196202 method , url , headers
@@ -213,11 +219,15 @@ async def test_proxy_https_requests(
213219 method = b"GET"
214220 url = (b"https" , b"example.org" , 443 , b"/" )
215221 headers = proxy_headers = [(b"host" , b"example.org" )]
222+ max_connections = 1
223+ max_keepalive = 2
216224 async with httpcore .AsyncHTTPProxy (
217225 proxy_server ,
218226 proxy_headers = proxy_headers ,
219227 proxy_mode = proxy_mode ,
220228 ssl_context = ca_ssl_context ,
229+ max_connections = max_connections ,
230+ max_keepalive = max_keepalive ,
221231 ) as http :
222232 http_version , status_code , reason , headers , stream = await http .request (
223233 method , url , headers
0 commit comments