Update nest tests to unload config entries to perform clean teardown (#130266)

This commit is contained in:
Allen Porter 2024-11-10 00:54:52 -08:00 committed by GitHub
parent ecd8dde347
commit 73a62a09b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -107,6 +107,7 @@ class FakeSubscriber(GoogleNestSubscriber):
def __init__(self) -> None: # pylint: disable=super-init-not-called
"""Initialize Fake Subscriber."""
self._device_manager = DeviceManager()
self._subscriber_name = "fake-name"
def set_update_callback(self, target: Callable[[EventMessage], Awaitable[None]]):
"""Capture the callback set by Home Assistant."""

View File

@ -22,6 +22,7 @@ from homeassistant.components.application_credentials import (
)
from homeassistant.components.nest import DOMAIN
from homeassistant.components.nest.const import CONF_SUBSCRIBER_ID, SDM_SCOPES
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
@ -287,6 +288,8 @@ async def setup_base_platform(
await hass.async_block_till_done()
yield _setup_func
if config_entry and config_entry.state == ConfigEntryState.LOADED:
await hass.config_entries.async_unload(config_entry.entry_id)
@pytest.fixture