Skip to content

Commit a0bd0dc

Browse files
ericapisaniclaude
andcommitted
test(pydantic-ai): Fix assertion for missing tool description
When a tool has no description, the tool_description field should be present in the span data but have a None value. Update the assertion to check for field presence rather than field absence. Also use `is None` instead of `== None` for proper Python style. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 352c03d commit a0bd0dc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/integrations/pydantic_ai/test_pydantic_ai.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,8 @@ def no_docs_tool(a: int, b: int) -> int:
28722872

28732873
tool_span = tool_spans[0]
28742874
assert tool_span["data"]["gen_ai.tool.name"] == "no_docs_tool"
2875-
assert SPANDATA.GEN_AI_TOOL_DESCRIPTION not in tool_span["data"]
2875+
assert SPANDATA.GEN_AI_TOOL_DESCRIPTION in tool_span["data"]
2876+
assert tool_span["data"][SPANDATA.GEN_AI_TOOL_DESCRIPTION] is None
28762877

28772878

28782879
@pytest.mark.asyncio

0 commit comments

Comments
 (0)