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

test_decorator_without_parentheses() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  55770029_1e35_bc6d_aa2c_f030dc29fb14["test_decorator_without_parentheses()"]
  e25ad18d_e1f6_726f_20bc_ac8e568d4e63["TestFunctionTool"]
  55770029_1e35_bc6d_aa2c_f030dc29fb14 -->|defined in| e25ad18d_e1f6_726f_20bc_ac8e568d4e63
  style 55770029_1e35_bc6d_aa2c_f030dc29fb14 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/lib/tools/test_functions.py lines 372–393

    def test_decorator_without_parentheses(self) -> None:
        """Test using @function_tool decorator without parentheses."""

        @beta_tool
        def multiply(x: int, y: int) -> str:
            """Multiply two numbers."""
            return str(x * y)

        assert multiply.name == "multiply"
        assert multiply.description == "Multiply two numbers."
        assert multiply.call({"x": 3, "y": 4}) == "12"

        expected_schema = {
            "additionalProperties": False,
            "type": "object",
            "properties": {
                "x": {"title": "X", "type": "integer"},
                "y": {"title": "Y", "type": "integer"},
            },
            "required": ["x", "y"],
        }
        assert multiply.input_schema == expected_schema

Subdomains

Frequently Asked Questions

What does test_decorator_without_parentheses() do?
test_decorator_without_parentheses() is a function in the anthropic-sdk-python codebase, defined in tests/lib/tools/test_functions.py.
Where is test_decorator_without_parentheses() defined?
test_decorator_without_parentheses() is defined in tests/lib/tools/test_functions.py at line 372.

Analyze Your Own Codebase

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

Try Supermodel Free