MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / test_timeout

Method test_timeout

tests/test_open_telemetry.py:1042–1049  ·  view source on GitHub ↗
(self, spans: Spans, respx_mock: MockRouter)

Source from the content-addressed store, hash-verified

1040
1041 @pytest.mark.respx(base_url=base_url)
1042 def test_timeout(self, spans: Spans, respx_mock: MockRouter) -> None:
1043 respx_mock.post("/v1/messages").mock(side_effect=httpx2.ReadTimeout("timeout"))
1044 client = make_client(spans, max_retries=0)
1045
1046 with pytest.raises(APITimeoutError):
1047 create(client)
1048
1049 assert attributes(spans.one("anthropic.messages.create"))["error.type"] == "client_timeout_error"
1050
1051 @pytest.mark.respx(base_url=base_url)
1052 def test_a_retried_call_has_one_span(self, spans: Spans, respx_mock: MockRouter) -> None:

Callers

nothing calls this directly

Calls 5

make_clientFunction · 0.70
createFunction · 0.70
attributesFunction · 0.70
postMethod · 0.45
oneMethod · 0.45

Tested by

no test coverage detected