File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ from ._protocol.outgoing cimport DNSOutgoing
88
99
1010cdef object RecordUpdate
11- cdef object _DNS_PTR_MIN_TTL
1211
1312cdef class QueryHandler:
1413
Original file line number Diff line number Diff line change 1616from typing import Set , cast
1717from unittest .mock import patch
1818
19+ try :
20+ from unittest .mock import AsyncMock
21+ except ImportError :
22+ from unittest .mock import Mock as AsyncMock # type: ignore[misc]
23+
1924import pytest
2025
2126import zeroconf as r
@@ -818,8 +823,8 @@ def _background_register():
818823@pytest .mark .asyncio
819824@unittest .skipIf (sys .version_info [:3 ][1 ] < 8 , 'Requires Python 3.8 or later to patch _async_setup' )
820825@patch ("zeroconf._core._STARTUP_TIMEOUT" , 0 )
821- @patch ("zeroconf._core.AsyncEngine._async_setup" )
822- async def test_event_loop_blocked (mock_start ):
826+ @patch ("zeroconf._core.AsyncEngine._async_setup" , AsyncMock () )
827+ async def test_event_loop_blocked ():
823828 """Test we raise NotRunningException when waiting for startup that times out."""
824829 aiozc = AsyncZeroconf (interfaces = ['127.0.0.1' ])
825830 with pytest .raises (NotRunningException ):
You can’t perform that action at this time.
0 commit comments