Make sure gardena bluetooth mock unload if it mocks load (#148920)

This commit is contained in:
Joakim Plate 2025-07-17 09:00:44 +02:00 committed by GitHub
parent a0991134c4
commit 5383ff96ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,8 +29,18 @@ def mock_entry():
)
@pytest.fixture
def mock_setup_entry() -> Generator[AsyncMock]:
@pytest.fixture(scope="module")
def mock_unload_entry() -> Generator[AsyncMock]:
"""Override async_unload_entry."""
with patch(
"homeassistant.components.gardena_bluetooth.async_unload_entry",
return_value=True,
) as mock_unload_entry:
yield mock_unload_entry
@pytest.fixture(scope="module")
def mock_setup_entry(mock_unload_entry) -> Generator[AsyncMock]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.gardena_bluetooth.async_setup_entry",