From 97ad6e15b46e6815451e8d715cfb5a64762e2040 Mon Sep 17 00:00:00 2001 From: Ariel Ebersberger Date: Mon, 30 Mar 2026 09:50:18 +0200 Subject: [PATCH] Patch mock_setup_entry fixture to also mock async_unload_entry --- tests/components/shelly/conftest.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/components/shelly/conftest.py b/tests/components/shelly/conftest.py index f3a583035e791..137d5dc9f3e06 100644 --- a/tests/components/shelly/conftest.py +++ b/tests/components/shelly/conftest.py @@ -793,10 +793,13 @@ def _initialize(): @pytest.fixture def mock_setup_entry() -> Generator[AsyncMock]: - """Override async_setup_entry.""" - with patch( - "homeassistant.components.shelly.async_setup_entry", return_value=True - ) as mock_setup_entry: + """Override async_setup_entry and async_unload_entry.""" + with ( + patch( + "homeassistant.components.shelly.async_setup_entry", return_value=True + ) as mock_setup_entry, + patch("homeassistant.components.shelly.async_unload_entry", return_value=True), + ): yield mock_setup_entry