MCPcopy
hub / github.com/encode/httpx / test_proxies_environ

Function test_proxies_environ

tests/client/test_proxies.py:226–236  ·  view source on GitHub ↗
(monkeypatch, client_class, url, env, expected)

Source from the content-addressed store, hash-verified

224)
225@pytest.mark.parametrize("client_class", [httpx.Client, httpx.AsyncClient])
226def test_proxies_environ(monkeypatch, client_class, url, env, expected):
227 for name, value in env.items():
228 monkeypatch.setenv(name, value)
229
230 client = client_class()
231 transport = client._transport_for_url(httpx.URL(url))
232
233 if expected is None:
234 assert transport == client._transport
235 else:
236 assert transport._pool._proxy_url == url_to_origin(expected)
237
238
239@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

url_to_originFunction · 0.85
itemsMethod · 0.45
_transport_for_urlMethod · 0.45

Tested by

no test coverage detected