mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 13:00:11 +00:00
Refactor zeroconf setup to be async (#39955)
* Refactor zeroconf setup to be async Most of the setup was calling back to async because we were setting up listeners. Since we only need to jump into the executor to create the zeroconf instance, its much faster to setup in async. In testing this cut the setup time in half or better. * partial revert to after_deps
This commit is contained in:
@@ -6,13 +6,6 @@ from homeassistant.setup import async_setup_component
|
||||
from tests.async_mock import patch
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_zeroconf():
|
||||
"""Mock zeroconf."""
|
||||
with patch("homeassistant.components.zeroconf.HaZeroconf"):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_ssdp():
|
||||
"""Mock ssdp."""
|
||||
@@ -34,6 +27,6 @@ def recorder_url_mock():
|
||||
yield
|
||||
|
||||
|
||||
async def test_setup(hass):
|
||||
async def test_setup(hass, mock_zeroconf):
|
||||
"""Test setup."""
|
||||
assert await async_setup_component(hass, "default_config", {"foo": "bar"})
|
||||
|
||||
Reference in New Issue
Block a user