Files
wehub-resource-sync 1443d3fdf9
Ruff Format Check / Ruff Format & Lint (push) Failing after 7m39s
Deploy VitePress site to Pages / build (push) Failing after 9m11s
Deploy VitePress site to Pages / Deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:32:26 +08:00

19 lines
538 B
Python

from __future__ import annotations
from yuxi.agents.toolkits.registry import tool
def test_tool_decorator_sets_handle_tool_error():
"""测试通过 @tool 装饰器注册的工具是否自动设置了 handle_tool_error 为 True"""
@tool(
category="test",
display_name="测试工具",
description="这是一个单元测试工具",
)
def my_test_tool(arg: str) -> str:
return f"hello {arg}"
assert my_test_tool.name == "my_test_tool"
assert my_test_tool.handle_tool_error is True