Eagerly unload config entries in tests (#111707)

This is a small latancy reduction to reduce test wall clock time
since it runs every test
This commit is contained in:
J. Nick Koston 2024-02-28 09:03:21 -10:00 committed by GitHub
parent 104884056f
commit 327796a750
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,6 +63,7 @@ from homeassistant.helpers import (
from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.typing import ConfigType
from homeassistant.setup import BASE_PLATFORMS, async_setup_component from homeassistant.setup import BASE_PLATFORMS, async_setup_component
from homeassistant.util import location from homeassistant.util import location
from homeassistant.util.async_ import create_eager_task
from homeassistant.util.json import json_loads from homeassistant.util.json import json_loads
from .ignore_uncaught_exceptions import IGNORE_UNCAUGHT_EXCEPTIONS from .ignore_uncaught_exceptions import IGNORE_UNCAUGHT_EXCEPTIONS
@ -555,7 +556,7 @@ async def hass(
# to ensure that they could, and to help track lingering tasks and timers. # to ensure that they could, and to help track lingering tasks and timers.
await asyncio.gather( await asyncio.gather(
*( *(
config_entry.async_unload(hass) create_eager_task(config_entry.async_unload(hass))
for config_entry in hass.config_entries.async_entries() for config_entry in hass.config_entries.async_entries()
) )
) )