Skip to content

Commit fd6313f

Browse files
committed
fix: test
1 parent 502c30d commit fd6313f

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/zeroconf/_handlers.pxd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ from ._protocol.outgoing cimport DNSOutgoing
88

99

1010
cdef object RecordUpdate
11-
cdef object _DNS_PTR_MIN_TTL
1211

1312
cdef class QueryHandler:
1413

tests/test_core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
from typing import Set, cast
1717
from 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+
1924
import pytest
2025

2126
import 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):

0 commit comments

Comments
 (0)