Home / Function/ test_retrying_status_errors_doesnt_leak() — anthropic-sdk-python Function Reference

test_retrying_status_errors_doesnt_leak() — anthropic-sdk-python Function Reference

Architecture documentation for the test_retrying_status_errors_doesnt_leak() function in test_client.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  356c4fe8_6fde_02c8_19ba_3ed89fe7bc9f["test_retrying_status_errors_doesnt_leak()"]
  d53b6c34_1743_a045_4be1_3554ab153964["TestAnthropic"]
  356c4fe8_6fde_02c8_19ba_3ed89fe7bc9f -->|defined in| d53b6c34_1743_a045_4be1_3554ab153964
  c81f470a_bfec_1ed9_415a_79cf5c2181e1["test_retrying_status_errors_doesnt_leak()"]
  c81f470a_bfec_1ed9_415a_79cf5c2181e1 -->|calls| 356c4fe8_6fde_02c8_19ba_3ed89fe7bc9f
  c81f470a_bfec_1ed9_415a_79cf5c2181e1["test_retrying_status_errors_doesnt_leak()"]
  356c4fe8_6fde_02c8_19ba_3ed89fe7bc9f -->|calls| c81f470a_bfec_1ed9_415a_79cf5c2181e1
  1555a14d_ad31_ef11_8c05_4240241d1d97["_get_open_connections()"]
  356c4fe8_6fde_02c8_19ba_3ed89fe7bc9f -->|calls| 1555a14d_ad31_ef11_8c05_4240241d1d97
  style 356c4fe8_6fde_02c8_19ba_3ed89fe7bc9f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_client.py lines 891–905

    def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Anthropic) -> None:
        respx_mock.post("/v1/messages").mock(return_value=httpx.Response(500))

        with pytest.raises(APIStatusError):
            client.messages.with_streaming_response.create(
                max_tokens=1024,
                messages=[
                    {
                        "content": "Hello, world",
                        "role": "user",
                    }
                ],
                model="claude-opus-4-6",
            ).__enter__()
        assert _get_open_connections(client) == 0

Subdomains

Frequently Asked Questions

What does test_retrying_status_errors_doesnt_leak() do?
test_retrying_status_errors_doesnt_leak() is a function in the anthropic-sdk-python codebase, defined in tests/test_client.py.
Where is test_retrying_status_errors_doesnt_leak() defined?
test_retrying_status_errors_doesnt_leak() is defined in tests/test_client.py at line 891.
What does test_retrying_status_errors_doesnt_leak() call?
test_retrying_status_errors_doesnt_leak() calls 2 function(s): _get_open_connections, test_retrying_status_errors_doesnt_leak.
What calls test_retrying_status_errors_doesnt_leak()?
test_retrying_status_errors_doesnt_leak() is called by 1 function(s): test_retrying_status_errors_doesnt_leak.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free