MCPcopy
hub / github.com/openai/openai-python / test_client_timeout_option

Method test_client_timeout_option

tests/test_client.py:1609–1622  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1607 assert timeout == httpx.Timeout(100.0)
1608
1609 async def test_client_timeout_option(self) -> None:
1610 client = AsyncOpenAI(
1611 base_url=base_url,
1612 api_key=api_key,
1613 admin_api_key=admin_api_key,
1614 _strict_response_validation=True,
1615 timeout=httpx.Timeout(0),
1616 )
1617
1618 request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
1619 timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
1620 assert timeout == httpx.Timeout(0)
1621
1622 await client.close()
1623
1624 async def test_http_client_timeout_option(self) -> None:
1625 # custom timeout given to the httpx client should be used

Callers

nothing calls this directly

Calls 4

AsyncOpenAIClass · 0.90
FinalRequestOptionsClass · 0.90
_build_requestMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected