Skip to content

Commit bfd01d3

Browse files
committed
Use mock patch annotation for watchdog period
1 parent 464a9ff commit bfd01d3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/application/test_connect.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
from unittest.mock import AsyncMock, patch
32

43
import pytest
@@ -201,14 +200,12 @@ async def test_disconnect_failure(device, make_application):
201200

202201

203202
@pytest.mark.parametrize("device", [FormedLaunchpadCC26X2R1])
203+
@patch("zigpy_znp.zigbee.application.ControllerApplication._watchdog_period", new=0.1)
204204
async def test_watchdog(device, make_application):
205205
app, znp_server = make_application(server_cls=device)
206206
app._watchdog_feed = AsyncMock(wraps=app._watchdog_feed)
207207

208-
with patch("zigpy.application.ControllerApplication._watchdog_period", new=0.1):
209-
await app.startup(auto_form=False)
210-
await asyncio.sleep(0.6)
211-
208+
await app.startup(auto_form=False)
212209
assert len(app._watchdog_feed.mock_calls) >= 5
213210

214211
await app.shutdown()

0 commit comments

Comments
 (0)