File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919from zeroconf ._utils .time import current_time_millis
2020
2121
22+ from . import _clear_cache
23+
24+
2225@pytest .fixture (autouse = True )
2326def verify_threads_ended ():
2427 """Verify that the threads are not running after the test."""
@@ -387,10 +390,7 @@ async def test_service_info_async_request() -> None:
387390 assert aiosinfos [1 ].addresses == [socket .inet_aton ("10.0.1.5" )]
388391
389392 aiosinfo = AsyncServiceInfo (type_ , registration_name )
390- zc_cache = aiozc .zeroconf .cache
391- for name in zc_cache .names ():
392- for record in zc_cache .entries_with_name (name ):
393- zc_cache .remove (record )
393+ _clear_cache (aiozc .zeroconf )
394394 # Generating the race condition is almost impossible
395395 # without patching since its a TOCTOU race
396396 with unittest .mock .patch ("zeroconf.aio.AsyncServiceInfo._is_complete" , False ):
You can’t perform that action at this time.
0 commit comments