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

test_deprecated_model_warning_stream() — anthropic-sdk-python Function Reference

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

Function python AnthropicClient AsyncAPI calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  f7e860e3_4079_9840_ae67_41cb6c3ab5c9["test_deprecated_model_warning_stream()"]
  3b785fa6_7fe8_27f9_a4b3_d1b931c9e188["TestAsyncMessages"]
  f7e860e3_4079_9840_ae67_41cb6c3ab5c9 -->|defined in| 3b785fa6_7fe8_27f9_a4b3_d1b931c9e188
  c576415a_9a32_814a_a7c5_0eae9ec6bc91["test_deprecated_model_warning_stream()"]
  c576415a_9a32_814a_a7c5_0eae9ec6bc91 -->|calls| f7e860e3_4079_9840_ae67_41cb6c3ab5c9
  c576415a_9a32_814a_a7c5_0eae9ec6bc91["test_deprecated_model_warning_stream()"]
  f7e860e3_4079_9840_ae67_41cb6c3ab5c9 -->|calls| c576415a_9a32_814a_a7c5_0eae9ec6bc91
  cb02636d_b74b_7724_2966_191b6bc19c0f["to_async_iter()"]
  f7e860e3_4079_9840_ae67_41cb6c3ab5c9 -->|calls| cb02636d_b74b_7724_2966_191b6bc19c0f
  d1b2725b_0ccb_90ce_868b_51db8c397a89["get_response()"]
  f7e860e3_4079_9840_ae67_41cb6c3ab5c9 -->|calls| d1b2725b_0ccb_90ce_868b_51db8c397a89
  style f7e860e3_4079_9840_ae67_41cb6c3ab5c9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/lib/streaming/test_beta_messages.py lines 313–326

    async def test_deprecated_model_warning_stream(self, respx_mock: MockRouter) -> None:
        for deprecated_model in DEPRECATED_MODELS:
            respx_mock.post("/v1/messages").mock(
                return_value=httpx.Response(200, content=to_async_iter(get_response("basic_response.txt")))
            )

            with pytest.warns(DeprecationWarning, match=f"The model '{deprecated_model}' is deprecated"):
                async with async_client.beta.messages.stream(
                    max_tokens=1024,
                    messages=[{"role": "user", "content": "Hello"}],
                    model=deprecated_model,
                ) as stream:
                    # Consume the stream to ensure the warning is triggered
                    await stream.get_final_message()

Subdomains

Frequently Asked Questions

What does test_deprecated_model_warning_stream() do?
test_deprecated_model_warning_stream() is a function in the anthropic-sdk-python codebase, defined in tests/lib/streaming/test_beta_messages.py.
Where is test_deprecated_model_warning_stream() defined?
test_deprecated_model_warning_stream() is defined in tests/lib/streaming/test_beta_messages.py at line 313.
What does test_deprecated_model_warning_stream() call?
test_deprecated_model_warning_stream() calls 3 function(s): get_response, test_deprecated_model_warning_stream, to_async_iter.
What calls test_deprecated_model_warning_stream()?
test_deprecated_model_warning_stream() is called by 1 function(s): test_deprecated_model_warning_stream.

Analyze Your Own Codebase

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

Try Supermodel Free