diff --git a/tests/components/shelly/conftest.py b/tests/components/shelly/conftest.py new file mode 100644 index 00000000000..3f97c0ef317 --- /dev/null +++ b/tests/components/shelly/conftest.py @@ -0,0 +1,11 @@ +"""Test configuration for Shelly.""" +import pytest + +from tests.async_mock import patch + + +@pytest.fixture(autouse=True) +def mock_coap(): + """Mock out coap.""" + with patch("homeassistant.components.shelly.get_coap_context"): + yield diff --git a/tests/components/shelly/test_config_flow.py b/tests/components/shelly/test_config_flow.py index bef018e7d91..1796847bd74 100644 --- a/tests/components/shelly/test_config_flow.py +++ b/tests/components/shelly/test_config_flow.py @@ -36,7 +36,7 @@ async def test_form(hass): assert result["type"] == "form" assert result["errors"] == {} - with patch("aioshelly.COAP", return_value=Mock(initialize=AsyncMock())), patch( + with patch( "aioshelly.get_info", return_value={"mac": "test-mac", "type": "SHSW-1", "auth": False}, ), patch(