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

test_default_stream_cls() — anthropic-sdk-python Function Reference

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

Function python AnthropicClient SyncAPI calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  819c1553_523f_e705_fb86_4de8b405aafa["test_default_stream_cls()"]
  9bf4cfe0_e3b0_70de_25ac_2113c8918900["TestAsyncAnthropic"]
  819c1553_523f_e705_fb86_4de8b405aafa -->|defined in| 9bf4cfe0_e3b0_70de_25ac_2113c8918900
  777189d1_1240_9503_aeca_212697474712["test_default_stream_cls()"]
  777189d1_1240_9503_aeca_212697474712 -->|calls| 819c1553_523f_e705_fb86_4de8b405aafa
  777189d1_1240_9503_aeca_212697474712["test_default_stream_cls()"]
  819c1553_523f_e705_fb86_4de8b405aafa -->|calls| 777189d1_1240_9503_aeca_212697474712
  style 819c1553_523f_e705_fb86_4de8b405aafa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_client.py lines 1805–1813

    async def test_default_stream_cls(self, respx_mock: MockRouter, async_client: AsyncAnthropic) -> None:
        class Model(BaseModel):
            name: str

        respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"}))

        stream = await async_client.post("/foo", cast_to=Model, stream=True, stream_cls=AsyncStream[Model])
        assert isinstance(stream, AsyncStream)
        await stream.response.aclose()

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free