Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9efde8c

Browse filesBrowse files
authored
feat: cythonize _listener.py to improve incoming message processing performance (#1220)
1 parent f4c17eb commit 9efde8c
Copy full SHA for 9efde8c

File tree

2 files changed

+9
-1
lines changed
Filter options

2 files changed

+9
-1
lines changed

‎build_ext.py

Copy file name to clipboardExpand all lines: build_ext.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def build(setup_kwargs: Any) -> None:
2525
[
2626
"src/zeroconf/_dns.py",
2727
"src/zeroconf/_cache.py",
28+
"src/zeroconf/_listener.py",
2829
"src/zeroconf/_protocol/incoming.py",
2930
"src/zeroconf/_protocol/outgoing.py",
3031
],

‎tests/test_core.py

Copy file name to clipboardExpand all lines: tests/test_core.py
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
from typing import cast
1616
from unittest.mock import patch
1717

18+
if sys.version_info[:3][1] < 8:
19+
from unittest.mock import Mock
20+
21+
AsyncMock = Mock
22+
else:
23+
from unittest.mock import AsyncMock
24+
1825
import pytest
1926

2027
import zeroconf as r
@@ -669,7 +676,7 @@ def _background_register():
669676
@pytest.mark.asyncio
670677
@unittest.skipIf(sys.version_info[:3][1] < 8, 'Requires Python 3.8 or later to patch _async_setup')
671678
@patch("zeroconf._core._STARTUP_TIMEOUT", 0)
672-
@patch("zeroconf._core.AsyncEngine._async_setup")
679+
@patch("zeroconf._core.AsyncEngine._async_setup", new_callable=AsyncMock)
673680
async def test_event_loop_blocked(mock_start):
674681
"""Test we raise NotRunningException when waiting for startup that times out."""
675682
aiozc = AsyncZeroconf(interfaces=['127.0.0.1'])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.