Stub I/O when loading registries in tests (#87744)

This commit is contained in:
Paulus Schoutsen 2023-02-09 02:25:52 -05:00 committed by GitHub
parent 769e0356ad
commit f9dc562251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -310,13 +310,13 @@ async def async_test_home_assistant(event_loop, load_registries=True):
# Load the registries
if load_registries:
await asyncio.gather(
area_registry.async_load(hass),
device_registry.async_load(hass),
entity_registry.async_load(hass),
issue_registry.async_load(hass),
)
await hass.async_block_till_done()
with patch("homeassistant.helpers.storage.Store.async_load", return_value=None):
await asyncio.gather(
area_registry.async_load(hass),
device_registry.async_load(hass),
entity_registry.async_load(hass),
issue_registry.async_load(hass),
)
hass.data[bootstrap.DATA_REGISTRIES_LOADED] = None
hass.state = CoreState.running