mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Improve zeroconf test fixture (#49657)
This commit is contained in:
parent
3be8c9c1c0
commit
510a3ae915
@ -3,12 +3,15 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components import zeroconf
|
|
||||||
|
|
||||||
zeroconf.orig_install_multiple_zeroconf_catcher = (
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
zeroconf.install_multiple_zeroconf_catcher
|
def patch_zeroconf_multiple_catcher():
|
||||||
)
|
"""Patch zeroconf wrapper that detects if multiple instances are used."""
|
||||||
zeroconf.install_multiple_zeroconf_catcher = lambda zc: None
|
with patch(
|
||||||
|
"homeassistant.components.zeroconf.install_multiple_zeroconf_catcher",
|
||||||
|
side_effect=lambda zc: None,
|
||||||
|
):
|
||||||
|
yield
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user