Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/test_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
from zeroconf._utils.time import current_time_millis


from . import _clear_cache


@pytest.fixture(autouse=True)
def verify_threads_ended():
"""Verify that the threads are not running after the test."""
Expand Down Expand Up @@ -387,10 +390,7 @@ async def test_service_info_async_request() -> None:
assert aiosinfos[1].addresses == [socket.inet_aton("10.0.1.5")]

aiosinfo = AsyncServiceInfo(type_, registration_name)
zc_cache = aiozc.zeroconf.cache
for name in zc_cache.names():
for record in zc_cache.entries_with_name(name):
zc_cache.remove(record)
_clear_cache(aiozc.zeroconf)
# Generating the race condition is almost impossible
# without patching since its a TOCTOU race
with unittest.mock.patch("zeroconf.aio.AsyncServiceInfo._is_complete", False):
Expand Down