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.

Function python AnthropicClient SyncAPI calls 2 called by 1

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

tests/test_client.py lines 1888–1904

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

        with pytest.raises(APIStatusError):
            await async_client.messages.with_streaming_response.create(
                max_tokens=1024,
                messages=[
                    {
                        "content": "Hello, world",
                        "role": "user",
                    }
                ],
                model="claude-opus-4-6",
            ).__aenter__()
        assert _get_open_connections(async_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 1888.
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