Ensure test async_create_task eager start behavior matches production (#115517)

This commit is contained in:
J. Nick Koston
2024-04-13 10:58:52 -10:00
committed by GitHub
parent d9617a8e3a
commit ee535ee611
30 changed files with 125 additions and 82 deletions

View File

@@ -460,6 +460,7 @@ async def test_show_progress_error(hass: HomeAssistant, manager) -> None:
async def async_step_init(self, user_input=None):
async def long_running_task() -> None:
await asyncio.sleep(0)
raise TypeError
if not self.progress_task:
@@ -518,7 +519,7 @@ async def test_show_progress_hidden_from_frontend(hass: HomeAssistant, manager)
nonlocal progress_task
async def long_running_job() -> None:
return
await asyncio.sleep(0)
if not progress_task:
progress_task = hass.async_create_task(long_running_job())