Use async_create_task in recorder init tests (#113586)

This commit is contained in:
J. Nick Koston 2024-03-16 04:40:50 -10:00 committed by GitHub
parent d17e397455
commit ef0c17749f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -142,7 +142,7 @@ async def test_shutdown_before_startup_finishes(
hass.set_state(CoreState.not_running)
recorder_helper.async_initialize_recorder(hass)
hass.create_task(async_setup_recorder_instance(hass, config))
hass.async_create_task(async_setup_recorder_instance(hass, config))
await recorder_helper.async_wait_recorder(hass)
instance = get_instance(hass)
@ -172,7 +172,7 @@ async def test_canceled_before_startup_finishes(
"""Test recorder shuts down when its startup future is canceled out from under it."""
hass.set_state(CoreState.not_running)
recorder_helper.async_initialize_recorder(hass)
hass.create_task(async_setup_recorder_instance(hass))
hass.async_create_task(async_setup_recorder_instance(hass))
await recorder_helper.async_wait_recorder(hass)
instance = get_instance(hass)
@ -224,7 +224,7 @@ async def test_state_gets_saved_when_set_before_start_event(
hass.set_state(CoreState.not_running)
recorder_helper.async_initialize_recorder(hass)
hass.create_task(async_setup_recorder_instance(hass))
hass.async_create_task(async_setup_recorder_instance(hass))
await recorder_helper.async_wait_recorder(hass)
entity_id = "test.recorder"
@ -2509,7 +2509,7 @@ async def test_commit_before_commits_pending_writes(
}
recorder_helper.async_initialize_recorder(hass)
hass.create_task(async_setup_recorder_instance(hass, config))
hass.async_create_task(async_setup_recorder_instance(hass, config))
await recorder_helper.async_wait_recorder(hass)
instance = get_instance(hass)
assert instance.commit_interval == 60