Skip to content

Commit 7eb6f7c

Browse files
authored
Fix romy tests opening sockets (home-assistant#156466)
1 parent a7d01b0 commit 7eb6f7c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/components/romy/test_config_flow.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""Test the ROMY config flow."""
22

3+
from collections.abc import Generator
34
from ipaddress import ip_address
4-
from unittest.mock import Mock, PropertyMock, patch
5+
from unittest.mock import AsyncMock, Mock, PropertyMock, patch
56

7+
import pytest
68
from romy import RomyRobot
79

810
from homeassistant import config_entries
@@ -44,6 +46,15 @@ def _create_mocked_romy(
4446
}
4547

4648

49+
@pytest.fixture(autouse=True)
50+
def mock_setup_entry() -> Generator[AsyncMock]:
51+
"""Override async_setup_entry."""
52+
with patch(
53+
"homeassistant.components.romy.async_setup_entry", return_value=True
54+
) as mock_setup_entry:
55+
yield mock_setup_entry
56+
57+
4758
async def test_show_user_form_robot_is_offline_and_locked(hass: HomeAssistant) -> None:
4859
"""Test that the user set up form with config."""
4960

0 commit comments

Comments
 (0)