Improve zeroconf test fixture (#49657)

pull/49669/head
Marc Mueller 2021-04-25 20:16:38 +02:00 committed by GitHub
parent 3be8c9c1c0
commit 510a3ae915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -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)