Small improvement to test run time (#113175)

This commit is contained in:
J. Nick Koston 2024-03-12 12:01:39 -10:00 committed by GitHub
parent 5ab7cb6ddd
commit 1cceaaf193
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -295,7 +295,9 @@ async def async_test_home_assistant(
},
)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, hass.config_entries._async_shutdown
EVENT_HOMEASSISTANT_STOP,
hass.config_entries._async_shutdown,
run_immediately=True,
)
# Load the registries
@ -878,7 +880,9 @@ class MockEntityPlatform(entity_platform.EntityPlatform):
def _async_on_stop(_: Event) -> None:
self.async_shutdown()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_on_stop)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, _async_on_stop, run_immediately=True
)
class MockToggleEntity(entity.ToggleEntity):