Small speed up to checking core state (#107845)

This commit is contained in:
J. Nick Koston 2024-01-18 08:41:32 -10:00 committed by GitHub
parent 32b0bf6b4e
commit c399cab427
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 176 additions and 165 deletions

View file

@ -31,7 +31,7 @@ async def test_if_fires_on_hass_start(
) -> None:
"""Test the firing when Home Assistant starts."""
calls = async_mock_service(hass, "test", "automation")
hass.state = CoreState.not_running
hass.set_state(CoreState.not_running)
assert await async_setup_component(hass, automation.DOMAIN, hass_config)
assert automation.is_on(hass, "automation.hello")
@ -54,7 +54,7 @@ async def test_if_fires_on_hass_start(
async def test_if_fires_on_hass_shutdown(hass: HomeAssistant) -> None:
"""Test the firing when Home Assistant shuts down."""
calls = async_mock_service(hass, "test", "automation")
hass.state = CoreState.not_running
hass.set_state(CoreState.not_running)
assert await async_setup_component(
hass,