Use identity checks for CoreState (#107846)

Some of the checks used ==, and some used is. Switch
everything to is as its faster
This commit is contained in:
J. Nick Koston 2024-01-11 23:21:26 -10:00 committed by GitHub
parent b12291633c
commit 4b7a313ece
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 45 additions and 45 deletions

View file

@ -8,7 +8,7 @@ from homeassistant.helpers import start
async def test_at_start_when_running_awaitable(hass: HomeAssistant) -> None:
"""Test at start when already running."""
assert hass.state == CoreState.running
assert hass.state is CoreState.running
assert hass.is_running
calls = []
@ -33,7 +33,7 @@ async def test_at_start_when_running_callback(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
"""Test at start when already running."""
assert hass.state == CoreState.running
assert hass.state is CoreState.running
assert hass.is_running
calls = []
@ -110,7 +110,7 @@ async def test_cancelling_at_start_when_running(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
"""Test cancelling at start when already running."""
assert hass.state == CoreState.running
assert hass.state is CoreState.running
assert hass.is_running
calls = []
@ -151,7 +151,7 @@ async def test_cancelling_at_start_when_starting(hass: HomeAssistant) -> None:
async def test_at_started_when_running_awaitable(hass: HomeAssistant) -> None:
"""Test at started when already started."""
assert hass.state == CoreState.running
assert hass.state is CoreState.running
calls = []
@ -175,7 +175,7 @@ async def test_at_started_when_running_callback(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
"""Test at started when already running."""
assert hass.state == CoreState.running
assert hass.state is CoreState.running
calls = []
@ -257,7 +257,7 @@ async def test_cancelling_at_started_when_running(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
"""Test cancelling at start when already running."""
assert hass.state == CoreState.running
assert hass.state is CoreState.running
assert hass.is_running
calls = []