From 5f2ae37ee56753a1c84ff7567e7edffeb62d27ab Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 14 Apr 2025 14:26:29 +0200 Subject: [PATCH] Improve backup tests (#142785) --- tests/helpers/test_backup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/helpers/test_backup.py b/tests/helpers/test_backup.py index 10ff5cb855f..f6a4f28622e 100644 --- a/tests/helpers/test_backup.py +++ b/tests/helpers/test_backup.py @@ -17,6 +17,7 @@ async def test_async_get_manager(hass: HomeAssistant) -> None: backup_helper.async_initialize_backup(hass) task = asyncio.create_task(backup_helper.async_get_manager(hass)) assert await async_setup_component(hass, BACKUP_DOMAIN, {}) + await hass.async_block_till_done() manager = await task assert manager is hass.data[backup_helper.DATA_MANAGER] @@ -36,7 +37,5 @@ async def test_async_get_manager_backup_failed_setup(hass: HomeAssistant) -> Non side_effect=Exception("Boom!"), ): assert not await async_setup_component(hass, BACKUP_DOMAIN, {}) - with ( - pytest.raises(Exception, match="Boom!"), - ): + with pytest.raises(Exception, match="Boom!"): await backup_helper.async_get_manager(hass)