Protect loop set default executor (#37438)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
1 parent
f8651d9faa
commit
f49ce5d1b4
21 files changed
+387
-244
No files matched your search
@@ -8,8 +8,8 @@ from homeassistant.core import callback as ha_callback
|
||||
from tests.async_mock import patch
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def hk_driver():
|
||||
@pytest.fixture
|
||||
def hk_driver(loop):
|
||||
"""Return a custom AccessoryDriver instance for HomeKit accessory init."""
|
||||
with patch("pyhap.accessory_driver.Zeroconf"), patch(
|
||||
"pyhap.accessory_driver.AccessoryEncoder"
|
||||
@@ -18,7 +18,7 @@ def hk_driver():
|
||||
), patch(
|
||||
"pyhap.accessory_driver.AccessoryDriver.persist"
|
||||
):
|
||||
yield AccessoryDriver(pincode=b"123-45-678", address="127.0.0.1")
|
||||
yield AccessoryDriver(pincode=b"123-45-678", address="127.0.0.1", loop=loop)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -68,6 +68,11 @@ from tests.components.homekit.common import patch_debounce
|
||||
IP_ADDRESS = "127.0.0.1"
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def always_patch_driver(hk_driver):
|
||||
"""Load the hk_driver fixture."""
|
||||
|
||||
|
||||
@pytest.fixture(name="device_reg")
|
||||
def device_reg_fixture(hass):
|
||||
"""Return an empty, loaded, registry."""
|
||||
|
||||
@@ -215,7 +215,7 @@ def test_density_to_air_quality():
|
||||
assert density_to_air_quality(300) == 5
|
||||
|
||||
|
||||
async def test_show_setup_msg(hass):
|
||||
async def test_show_setup_msg(hass, hk_driver):
|
||||
"""Test show setup message as persistence notification."""
|
||||
pincode = b"123-45-678"
|
||||
|
||||
|
||||
Reference in new issue
Block a user