From ef0c17749fe837e13673c396f3ecf36289774dfa Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 16 Mar 2024 04:40:50 -1000 Subject: [PATCH] Use async_create_task in recorder init tests (#113586) --- tests/components/recorder/test_init.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/components/recorder/test_init.py b/tests/components/recorder/test_init.py index 238f6420c78..65f5869b6ca 100644 --- a/tests/components/recorder/test_init.py +++ b/tests/components/recorder/test_init.py @@ -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