diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f93d4fc..c16a90a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -93,6 +93,11 @@ jobs: uv run pytest ./tests/test_tools.py if: ${{ success() || failure() }} + - name: Tool validation tests + run: | + uv run pytest ./tests/test_tool_validation.py + if: ${{ success() || failure() }} + - name: Types tests run: | uv run pytest ./tests/test_types.py diff --git a/tests/test_tool_validation.py b/tests/test_tool_validation.py new file mode 100644 index 0000000..16cbe21 --- /dev/null +++ b/tests/test_tool_validation.py @@ -0,0 +1,9 @@ +import pytest + +from smolagents.default_tools import DuckDuckGoSearchTool, GoogleSearchTool, VisitWebpageTool +from smolagents.tool_validation import validate_tool_attributes + + +@pytest.mark.parametrize("tool_class", [DuckDuckGoSearchTool, GoogleSearchTool, VisitWebpageTool]) +def test_validate_tool_attributes(tool_class): + assert validate_tool_attributes(tool_class) is None, f"failed for {tool_class.name} tool"