Skip to content

Commit 7851bed

Browse files
authored
Fix zimi tests opening sockets (home-assistant#156382)
1 parent 6aba0b2 commit 7851bed

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/components/zimi/test_config_flow.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Tests for the zimi config flow."""
22

3-
from unittest.mock import MagicMock, patch
3+
from collections.abc import Generator
4+
from unittest.mock import AsyncMock, MagicMock, patch
45

56
import pytest
67
from zcc import (
@@ -44,6 +45,15 @@ def discovery_mock():
4445
yield mock
4546

4647

48+
@pytest.fixture(autouse=True)
49+
def mock_setup_entry() -> Generator[AsyncMock]:
50+
"""Override async_setup_entry."""
51+
with patch(
52+
"homeassistant.components.zimi.async_setup_entry", return_value=True
53+
) as mock_setup_entry:
54+
yield mock_setup_entry
55+
56+
4757
async def test_user_discovery_success(
4858
hass: HomeAssistant,
4959
discovery_mock: MagicMock,

0 commit comments

Comments
 (0)