from contextlib import nullcontext

import pytest

from smolagents.default_tools import TOOL_MAPPING
from smolagents.tool_validation import validate_tool_attributes


@pytest.mark.parametrize("tool_name, tool_class", TOOL_MAPPING.items())
def test_validate_tool_attributes(tool_name, tool_class):
    with nullcontext():
        assert validate_tool_attributes(tool_class) is None, f"failed for {tool_name} tool"
