Protect loop set default executor (#37438)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Paulus Schoutsen 2020-07-06 15:58:53 -07:00 committed by GitHub
parent f8651d9faa
commit f49ce5d1b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 387 additions and 244 deletions

View file

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