11#!/usr/bin/env python
2- # -*- coding: utf-8 -*-
32
43
54"""Unit tests for aio.py."""
@@ -57,11 +56,9 @@ def verify_threads_ended():
5756 yield
5857 threads_after = frozenset (threading .enumerate ())
5958 non_executor_threads = frozenset (
60- [
61- thread
62- for thread in threads_after
63- if "asyncio" not in thread .name and "ThreadPoolExecutor" not in thread .name
64- ]
59+ thread
60+ for thread in threads_after
61+ if "asyncio" not in thread .name and "ThreadPoolExecutor" not in thread .name
6562 )
6663 threads = non_executor_threads - threads_before
6764 assert not threads
@@ -119,7 +116,7 @@ async def test_async_service_registration() -> None:
119116 aiozc = AsyncZeroconf (interfaces = ['127.0.0.1' ])
120117 type_ = "_test1-srvc-type._tcp.local."
121118 name = "xxxyyy"
122- registration_name = "%s.%s" % ( name , type_ )
119+ registration_name = f" { name } . { type_ } "
123120
124121 calls = []
125122
@@ -179,7 +176,7 @@ async def test_async_service_registration_name_conflict() -> None:
179176 aiozc = AsyncZeroconf (interfaces = ['127.0.0.1' ])
180177 type_ = "_test-srvc2-type._tcp.local."
181178 name = "xxxyyy"
182- registration_name = "%s.%s" % ( name , type_ )
179+ registration_name = f" { name } . { type_ } "
183180
184181 desc = {'path' : '/~paulsm/' }
185182 info = ServiceInfo (
@@ -227,7 +224,7 @@ async def test_async_service_registration_name_does_not_match_type() -> None:
227224 aiozc = AsyncZeroconf (interfaces = ['127.0.0.1' ])
228225 type_ = "_test-srvc3-type._tcp.local."
229226 name = "xxxyyy"
230- registration_name = "%s.%s" % ( name , type_ )
227+ registration_name = f" { name } . { type_ } "
231228
232229 desc = {'path' : '/~paulsm/' }
233230 info = ServiceInfo (
@@ -254,7 +251,7 @@ async def test_async_tasks() -> None:
254251 aiozc = AsyncZeroconf (interfaces = ['127.0.0.1' ])
255252 type_ = "_test-srvc4-type._tcp.local."
256253 name = "xxxyyy"
257- registration_name = "%s.%s" % ( name , type_ )
254+ registration_name = f" { name } . { type_ } "
258255
259256 calls = []
260257
@@ -320,7 +317,7 @@ async def test_async_wait_unblocks_on_update() -> None:
320317 aiozc = AsyncZeroconf (interfaces = ['127.0.0.1' ])
321318 type_ = "_test-srvc4-type._tcp.local."
322319 name = "xxxyyy"
323- registration_name = "%s.%s" % ( name , type_ )
320+ registration_name = f" { name } . { type_ } "
324321
325322 desc = {'path' : '/~paulsm/' }
326323 info = ServiceInfo (
@@ -356,8 +353,8 @@ async def test_service_info_async_request() -> None:
356353 type_ = "_test1-srvc-type._tcp.local."
357354 name = "xxxyyy"
358355 name2 = "abc"
359- registration_name = "%s.%s" % ( name , type_ )
360- registration_name2 = "%s.%s" % ( name2 , type_ )
356+ registration_name = f" { name } . { type_ } "
357+ registration_name2 = f" { name2 } . { type_ } "
361358
362359 # Start a tasks BEFORE the registration that will keep trying
363360 # and see the registration a bit later
@@ -454,7 +451,7 @@ async def test_async_service_browser() -> None:
454451 aiozc = AsyncZeroconf (interfaces = ['127.0.0.1' ])
455452 type_ = "_test9-srvc-type._tcp.local."
456453 name = "xxxyyy"
457- registration_name = "%s.%s" % ( name , type_ )
454+ registration_name = f" { name } . { type_ } "
458455
459456 calls = []
460457
@@ -513,7 +510,7 @@ async def test_async_context_manager() -> None:
513510 """Test using an async context manager."""
514511 type_ = "_test10-sr-type._tcp.local."
515512 name = "xxxyyy"
516- registration_name = "%s.%s" % ( name , type_ )
513+ registration_name = f" { name } . { type_ } "
517514
518515 async with AsyncZeroconf (interfaces = ['127.0.0.1' ]) as aiozc :
519516 info = ServiceInfo (
@@ -539,8 +536,8 @@ async def test_async_unregister_all_services() -> None:
539536 type_ = "_test1-srvc-type._tcp.local."
540537 name = "xxxyyy"
541538 name2 = "abc"
542- registration_name = "%s.%s" % ( name , type_ )
543- registration_name2 = "%s.%s" % ( name2 , type_ )
539+ registration_name = f" { name } . { type_ } "
540+ registration_name2 = f" { name2 } . { type_ } "
544541
545542 desc = {'path' : '/~paulsm/' }
546543 info = ServiceInfo (
@@ -594,7 +591,7 @@ async def test_async_unregister_all_services() -> None:
594591async def test_async_zeroconf_service_types ():
595592 type_ = "_test-srvc-type._tcp.local."
596593 name = "xxxyyy"
597- registration_name = "%s.%s" % ( name , type_ )
594+ registration_name = f" { name } . { type_ } "
598595
599596 zeroconf_registrar = AsyncZeroconf (interfaces = ['127.0.0.1' ])
600597 desc = {'path' : '/~paulsm/' }
@@ -808,7 +805,7 @@ async def test_info_asking_default_is_asking_qm_questions_after_the_first_qu():
808805 zeroconf_info = aiozc .zeroconf
809806
810807 name = "xxxyyy"
811- registration_name = "%s.%s" % ( name , type_ )
808+ registration_name = f" { name } . { type_ } "
812809
813810 desc = {'path' : '/~paulsm/' }
814811 info = ServiceInfo (
0 commit comments