diff --git a/pyproject.toml b/pyproject.toml index a24618011d91..a16e180b02b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -848,6 +848,7 @@ mark-parentheses = false "async_timeout".msg = "use asyncio.timeout instead" "pytz".msg = "use zoneinfo instead" "tests".msg = "You should not import tests" +"voluptuous".msg = "use probatio instead" "__future__.annotations".msg = "It should not be needed because Home Assistant requires Python 3.14+" [tool.ruff.lint.isort] diff --git a/script/ruff.toml b/script/ruff.toml index a14712ec142f..357c77138720 100644 --- a/script/ruff.toml +++ b/script/ruff.toml @@ -9,3 +9,4 @@ forced-separate = [ [lint.flake8-tidy-imports.banned-api] "async_timeout".msg = "use asyncio.timeout instead" "pytz".msg = "use zoneinfo instead" +"voluptuous".msg = "use probatio instead" diff --git a/tests/components/mcp_server/test_http.py b/tests/components/mcp_server/test_http.py index f81a7b5fa755..51b2777f6932 100644 --- a/tests/components/mcp_server/test_http.py +++ b/tests/components/mcp_server/test_http.py @@ -14,8 +14,8 @@ import mcp.client.session import mcp.client.sse import mcp.client.streamable_http from mcp.shared.exceptions import McpError +import probatio import pytest -import voluptuous as vol from homeassistant.components.conversation import DOMAIN as CONVERSATION_DOMAIN from homeassistant.components.homeassistant.exposed_entities import async_expose_entity @@ -87,7 +87,7 @@ class _StubTool(llm.Tool): name = "test_tool" - def __init__(self, parameters: vol.Schema) -> None: + def __init__(self, parameters: probatio.Schema) -> None: """Initialize the stub tool.""" self.parameters = parameters @@ -638,12 +638,14 @@ async def test_mcp_tools_list( ("parameters", "expected_required"), [ pytest.param( - vol.Schema({vol.Required("name"): str, vol.Optional("area"): str}), + probatio.Schema( + {probatio.Required("name"): str, probatio.Optional("area"): str} + ), ["name"], id="required-and-optional", ), pytest.param( - vol.Schema({vol.Optional("area"): str}), + probatio.Schema({probatio.Optional("area"): str}), None, id="optional-only", ), @@ -655,7 +657,7 @@ async def test_mcp_tools_list_required_parameters( mcp_url: str, mcp_client: MCPClientFactory, hass_supervisor_access_token: str, - parameters: vol.Schema, + parameters: probatio.Schema, expected_required: list[str] | None, ) -> None: """Test the tools list advertises the required tool parameters.""" diff --git a/tests/ruff.toml b/tests/ruff.toml index d12fe8caead8..be9ad1ccf649 100644 --- a/tests/ruff.toml +++ b/tests/ruff.toml @@ -16,6 +16,7 @@ extend-ignore = [ [lint.flake8-tidy-imports.banned-api] "async_timeout".msg = "use asyncio.timeout instead" "pytz".msg = "use zoneinfo instead" +"voluptuous".msg = "use probatio instead" "syrupy.SnapshotAssertion".msg = "use syrupy.assertion.SnapshotAssertion instead" [lint.isort]