Skip to content

Commit 2dadc1f

Browse files
authored
Fix iskra tests opening sockets (home-assistant#156374)
1 parent 936151f commit 2dadc1f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/components/iskra/test_config_flow.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"""Tests for the Iskra config flow."""
22

3+
from collections.abc import Generator
4+
from unittest.mock import AsyncMock, patch
5+
36
from pyiskra.exceptions import (
47
DeviceConnectionError,
58
DeviceTimeoutError,
@@ -35,6 +38,15 @@
3538
from tests.common import MockConfigEntry
3639

3740

41+
@pytest.fixture(autouse=True)
42+
def mock_setup_entry() -> Generator[AsyncMock]:
43+
"""Override async_setup_entry."""
44+
with patch(
45+
"homeassistant.components.iskra.async_setup_entry", return_value=True
46+
) as mock_setup_entry:
47+
yield mock_setup_entry
48+
49+
3850
# Test step_user with Rest API protocol
3951
async def test_user_rest_no_auth(hass: HomeAssistant, mock_pyiskra_rest) -> None:
4052
"""Test the user flow with Rest API protocol."""

0 commit comments

Comments
 (0)