From 88f04bb3b483adfee4923bc8fe6a924880f3e0c6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 15 Mar 2024 12:33:48 -1000 Subject: [PATCH] Avoid calling entry.async_migrate in sonarr tests (#113557) We should setup the the config entry instead of calling the migrator directly This fix was reverted out in #113553 --- tests/components/sonarr/test_init.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/components/sonarr/test_init.py b/tests/components/sonarr/test_init.py index 9f512c11074..e663139d33c 100644 --- a/tests/components/sonarr/test_init.py +++ b/tests/components/sonarr/test_init.py @@ -105,7 +105,9 @@ async def test_migrate_config_entry(hass: HomeAssistant) -> None: assert entry.version == 1 assert not entry.unique_id - await entry.async_migrate(hass) + with patch("homeassistant.components.sonarr.async_setup_entry", return_value=True): + await hass.config_entries.async_setup(entry.entry_id) + await hass.async_block_till_done() assert entry.data == { CONF_API_KEY: "MOCK_API_KEY",