feat: migrate to native types · python-zeroconf/python-zeroconf@3d24643
@@ -6,8 +6,9 @@
66import socket
77import time
88import unittest
9+from collections.abc import Iterable
910from threading import Event
10-from typing import Iterable, List, Set, cast
11+from typing import cast
1112from unittest.mock import patch
12131314import pytest
@@ -580,7 +581,7 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
580581old_send = zeroconf_browser.async_send
581582582583expected_ttl = const._DNS_OTHER_TTL
583-questions: List[List[DNSQuestion]] = []
584+questions: list[list[DNSQuestion]] = []
584585585586def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
586587"""Sends an outgoing packet."""
@@ -1151,7 +1152,7 @@ async def test_generate_service_query_suppress_duplicate_questions():
1151115210000,
11521153f"known-to-other.{name}",
11531154 )
1154-other_known_answers: Set[r.DNSRecord] = {answer}
1155+other_known_answers: set[r.DNSRecord] = {answer}
11551156zc.question_history.add_question_at_time(question, now, other_known_answers)
11561157assert zc.question_history.suppresses(question, now, other_known_answers)
11571158@@ -1196,7 +1197,7 @@ async def test_query_scheduler():
11961197aiozc = AsyncZeroconf(interfaces=["127.0.0.1"])
11971198await aiozc.zeroconf.async_wait_for_start()
11981199zc = aiozc.zeroconf
1199-sends: List[r.DNSIncoming] = []
1200+sends: list[r.DNSIncoming] = []
1200120112011202def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
12021203"""Sends an outgoing packet."""
@@ -1289,7 +1290,7 @@ async def test_query_scheduler_rescue_records():
12891290aiozc = AsyncZeroconf(interfaces=["127.0.0.1"])
12901291await aiozc.zeroconf.async_wait_for_start()
12911292zc = aiozc.zeroconf
1292-sends: List[r.DNSIncoming] = []
1293+sends: list[r.DNSIncoming] = []
1293129412941295def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
12951296"""Sends an outgoing packet."""