mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Prevent 3rd party lib from opening sockets in zeroconf tests (#56324)
This commit is contained in:
parent
fce7f0873e
commit
bce4c5eb11
@ -4,8 +4,14 @@ from unittest.mock import AsyncMock, patch
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def zc_mock_get_source_ip(mock_get_source_ip):
|
||||
"""Enable the mock_get_source_ip fixture for all zeroconf tests."""
|
||||
return mock_get_source_ip
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_async_zeroconf():
|
||||
def mock_async_zeroconf(mock_zeroconf):
|
||||
"""Mock AsyncZeroconf."""
|
||||
with patch("homeassistant.components.zeroconf.HaAsyncZeroconf") as mock_aiozc:
|
||||
zc = mock_aiozc.return_value
|
||||
|
Loading…
x
Reference in New Issue
Block a user