Improve zeroconf test fixture (#49657)
parent
3be8c9c1c0
commit
510a3ae915
|
@ -3,12 +3,15 @@ from unittest.mock import patch
|
|||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import zeroconf
|
||||
|
||||
zeroconf.orig_install_multiple_zeroconf_catcher = (
|
||||
zeroconf.install_multiple_zeroconf_catcher
|
||||
)
|
||||
zeroconf.install_multiple_zeroconf_catcher = lambda zc: None
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def patch_zeroconf_multiple_catcher():
|
||||
"""Patch zeroconf wrapper that detects if multiple instances are used."""
|
||||
with patch(
|
||||
"homeassistant.components.zeroconf.install_multiple_zeroconf_catcher",
|
||||
side_effect=lambda zc: None,
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
Loading…
Reference in New Issue