File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212python-slugify
1313zigpy>=0.65.2
1414ruff
15- looptime
15+ looptime>=0.7
1616freezegun
1717coloredlogs
Original file line number Diff line number Diff line change 1010from types import TracebackType
1111from unittest .mock import AsyncMock , MagicMock , patch
1212
13+ import looptime
1314import pytest
1415import zigpy
1516from zigpy .application import ControllerApplication
@@ -300,6 +301,7 @@ async def __aenter__(self) -> Gateway:
300301 """Start the ZHA gateway."""
301302
302303 with (
304+ looptime .enabled (),
303305 patch (
304306 "bellows.zigbee.application.ControllerApplication.new" ,
305307 return_value = self .app ,
@@ -322,8 +324,9 @@ async def __aexit__(
322324 ) -> None :
323325 """Shutdown the ZHA gateway."""
324326 INSTANCES .remove (self .zha_gateway )
325- await self .zha_gateway .shutdown ()
326- await asyncio .sleep (0 )
327+ with looptime .enabled ():
328+ await self .zha_gateway .shutdown ()
329+ await asyncio .sleep (0 )
327330
328331
329332@pytest .fixture
You can’t perform that action at this time.
0 commit comments