mirror of
https://github.com/home-assistant/core.git
synced 2026-04-02 00:20:30 +01:00
Fix lingering tasks in update_coordinator test (#166968)
This commit is contained in:
@@ -534,7 +534,7 @@ async def test_update_locks(
|
|||||||
|
|
||||||
# Add subscriber
|
# Add subscriber
|
||||||
update_callback = Mock()
|
update_callback = Mock()
|
||||||
crd.async_add_listener(update_callback)
|
remove_callbacks = crd.async_add_listener(update_callback)
|
||||||
|
|
||||||
assert crd.update_interval
|
assert crd.update_interval
|
||||||
|
|
||||||
@@ -578,6 +578,10 @@ async def test_update_locks(
|
|||||||
# Unblock queued update
|
# Unblock queued update
|
||||||
block.set()
|
block.set()
|
||||||
|
|
||||||
|
# Remove callbacks to avoid lingering timers
|
||||||
|
remove_callbacks()
|
||||||
|
await crd.async_shutdown()
|
||||||
|
|
||||||
|
|
||||||
async def test_refresh_recover(
|
async def test_refresh_recover(
|
||||||
crd: update_coordinator.DataUpdateCoordinator[int], caplog: pytest.LogCaptureFixture
|
crd: update_coordinator.DataUpdateCoordinator[int], caplog: pytest.LogCaptureFixture
|
||||||
|
|||||||
Reference in New Issue
Block a user