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

test_parse_rejects_both_output_format_and_config() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ca06593f_93d5_8e37_5f46_6fe7bfbbb8d8["test_parse_rejects_both_output_format_and_config()"]
  3fe92a68_5610_d400_14e9_4b7e189d5cae["TestOutputConfigConflict"]
  ca06593f_93d5_8e37_5f46_6fe7bfbbb8d8 -->|defined in| 3fe92a68_5610_d400_14e9_4b7e189d5cae
  style ca06593f_93d5_8e37_5f46_6fe7bfbbb8d8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/api_resources/beta/test_output_format_conversion.py lines 326–339

    def test_parse_rejects_both_output_format_and_config(self, client: Anthropic) -> None:
        """Verify .parse() raises error when both output_format and output_config.format are provided."""

        class TestModel(BaseModel):
            value: str

        with pytest.raises(AnthropicError, match="Both output_format and output_config.format were provided"):
            client.beta.messages.parse(
                max_tokens=1024,
                messages=[{"role": "user", "content": "Test"}],
                model="claude-sonnet-4-5",
                output_format=TestModel,
                output_config={"format": {"type": "json_schema", "schema": {"type": "string"}}},
            )

Subdomains

Frequently Asked Questions

What does test_parse_rejects_both_output_format_and_config() do?
test_parse_rejects_both_output_format_and_config() is a function in the anthropic-sdk-python codebase, defined in tests/api_resources/beta/test_output_format_conversion.py.
Where is test_parse_rejects_both_output_format_and_config() defined?
test_parse_rejects_both_output_format_and_config() is defined in tests/api_resources/beta/test_output_format_conversion.py at line 326.

Analyze Your Own Codebase

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

Try Supermodel Free