test_http_client_timeout_option() — anthropic-sdk-python Function Reference
Architecture documentation for the test_http_client_timeout_option() function in test_client.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 8aa77014_e9b9_ece4_2363_ececdcc9df4e["test_http_client_timeout_option()"] 9bf4cfe0_e3b0_70de_25ac_2113c8918900["TestAsyncAnthropic"] 8aa77014_e9b9_ece4_2363_ececdcc9df4e -->|defined in| 9bf4cfe0_e3b0_70de_25ac_2113c8918900 c5c4685e_c879_bd1a_2a40_10f8966d502d["test_http_client_timeout_option()"] c5c4685e_c879_bd1a_2a40_10f8966d502d -->|calls| 8aa77014_e9b9_ece4_2363_ececdcc9df4e c5c4685e_c879_bd1a_2a40_10f8966d502d["test_http_client_timeout_option()"] 8aa77014_e9b9_ece4_2363_ececdcc9df4e -->|calls| c5c4685e_c879_bd1a_2a40_10f8966d502d style 8aa77014_e9b9_ece4_2363_ececdcc9df4e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_client.py lines 1312–1347
async def test_http_client_timeout_option(self) -> None:
# custom timeout given to the httpx client should be used
async with httpx.AsyncClient(timeout=None) as http_client:
client = AsyncAnthropic(
base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == httpx.Timeout(None)
await client.close()
# no timeout given to the httpx client should not use the httpx default
async with httpx.AsyncClient() as http_client:
client = AsyncAnthropic(
base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == DEFAULT_TIMEOUT
await client.close()
# explicitly passing the default timeout currently results in it being ignored
async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client:
client = AsyncAnthropic(
base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == DEFAULT_TIMEOUT # our default
await client.close()
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does test_http_client_timeout_option() do?
test_http_client_timeout_option() is a function in the anthropic-sdk-python codebase, defined in tests/test_client.py.
Where is test_http_client_timeout_option() defined?
test_http_client_timeout_option() is defined in tests/test_client.py at line 1312.
What does test_http_client_timeout_option() call?
test_http_client_timeout_option() calls 1 function(s): test_http_client_timeout_option.
What calls test_http_client_timeout_option()?
test_http_client_timeout_option() is called by 1 function(s): test_http_client_timeout_option.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free