File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,16 @@ def _make_groq_provider(overrides: dict | None = None) -> ProviderGroq:
6262
6363def test_create_http_client_uses_openai_httpx_module (monkeypatch ):
6464 captured : dict [str , object ] = {}
65+ fake_httpx_module = object ()
66+
67+ from openai import _base_client as openai_base_client
68+
69+ monkeypatch .setattr (
70+ openai_base_client ,
71+ "httpx" ,
72+ fake_httpx_module ,
73+ raising = False ,
74+ )
6575
6676 def fake_create_proxy_client (
6777 provider_label : str ,
@@ -82,9 +92,7 @@ def fake_create_proxy_client(
8292 provider = ProviderOpenAIOfficial .__new__ (ProviderOpenAIOfficial )
8393 provider ._create_http_client ({"proxy" : "" })
8494
85- from openai import _base_client as openai_base_client
86-
87- assert captured ["httpx_module" ] is openai_base_client .httpx
95+ assert captured ["httpx_module" ] is fake_httpx_module
8896
8997
9098def test_create_http_client_falls_back_to_global_httpx_module (monkeypatch ):
You can’t perform that action at this time.
0 commit comments