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 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  c576415a_9a32_814a_a7c5_0eae9ec6bc91["test_deprecated_model_warning_stream()"]
  9bc201ea_a885_b5a7_1802_da159bef751a["TestSyncMessages"]
  c576415a_9a32_814a_a7c5_0eae9ec6bc91 -->|defined in| 9bc201ea_a885_b5a7_1802_da159bef751a
  f7e860e3_4079_9840_ae67_41cb6c3ab5c9["test_deprecated_model_warning_stream()"]
  f7e860e3_4079_9840_ae67_41cb6c3ab5c9 -->|calls| c576415a_9a32_814a_a7c5_0eae9ec6bc91
  f7e860e3_4079_9840_ae67_41cb6c3ab5c9["test_deprecated_model_warning_stream()"]
  c576415a_9a32_814a_a7c5_0eae9ec6bc91 -->|calls| f7e860e3_4079_9840_ae67_41cb6c3ab5c9
  d1b2725b_0ccb_90ce_868b_51db8c397a89["get_response()"]
  c576415a_9a32_814a_a7c5_0eae9ec6bc91 -->|calls| d1b2725b_0ccb_90ce_868b_51db8c397a89
  style c576415a_9a32_814a_a7c5_0eae9ec6bc91 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/lib/streaming/test_beta_messages.py lines 251–264

    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=get_response("basic_response.txt"))
            )

            with pytest.warns(DeprecationWarning, match=f"The model '{deprecated_model}' is deprecated"):
                with sync_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
                    stream.until_done()

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 251.
What does test_deprecated_model_warning_stream() call?
test_deprecated_model_warning_stream() calls 2 function(s): get_response, test_deprecated_model_warning_stream.
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