1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix zeroconf mock and use it in CI group 1's tests (#55526)

* Fix zeroconf mock and use it in CI group 1's tests

* Mock HaAsyncServiceBrowser
This commit is contained in:
Erik Montnemery
2021-09-01 22:38:00 +02:00
committed by GitHub
parent e631671832
commit 7dbd0e5274
5 changed files with 31 additions and 30 deletions

View File

@@ -480,8 +480,10 @@ async def mqtt_mock(hass, mqtt_client_mock, mqtt_config):
@pytest.fixture
def mock_zeroconf():
"""Mock zeroconf."""
with patch("homeassistant.components.zeroconf.models.HaZeroconf") as mock_zc:
yield mock_zc.return_value
with patch("homeassistant.components.zeroconf.HaZeroconf", autospec=True), patch(
"homeassistant.components.zeroconf.HaAsyncServiceBrowser", autospec=True
):
yield
@pytest.fixture