diff --git a/tests/helpers/test_update_coordinator.py b/tests/helpers/test_update_coordinator.py index 77a3c90ee0e..d4a35c7aa55 100644 --- a/tests/helpers/test_update_coordinator.py +++ b/tests/helpers/test_update_coordinator.py @@ -534,7 +534,7 @@ async def test_update_locks( # Add subscriber update_callback = Mock() - crd.async_add_listener(update_callback) + remove_callbacks = crd.async_add_listener(update_callback) assert crd.update_interval @@ -578,6 +578,10 @@ async def test_update_locks( # Unblock queued update block.set() + # Remove callbacks to avoid lingering timers + remove_callbacks() + await crd.async_shutdown() + async def test_refresh_recover( crd: update_coordinator.DataUpdateCoordinator[int], caplog: pytest.LogCaptureFixture