55
66import asyncio
77import logging
8+ import os
89import pytest
910import socket
1011import time
1920from zeroconf .asyncio import AsyncZeroconf
2021
2122
22- from . import _clear_cache , _inject_response
23+ from . import _clear_cache , _inject_response , has_working_ipv6
2324
2425log = logging .getLogger ('zeroconf' )
2526original_logging_level = logging .NOTSET
@@ -274,6 +275,8 @@ def test_ptr_optimization():
274275 zc .close ()
275276
276277
278+ @unittest .skipIf (not has_working_ipv6 (), 'Requires IPv6' )
279+ @unittest .skipIf (os .environ .get ('SKIP_IPV6' ), 'IPv6 tests disabled' )
277280def test_any_query_for_ptr ():
278281 """Test that queries for ANY will return PTR records."""
279282 zc = Zeroconf (interfaces = ['127.0.0.1' ])
@@ -301,6 +304,8 @@ def test_any_query_for_ptr():
301304 zc .close ()
302305
303306
307+ @unittest .skipIf (not has_working_ipv6 (), 'Requires IPv6' )
308+ @unittest .skipIf (os .environ .get ('SKIP_IPV6' ), 'IPv6 tests disabled' )
304309def test_aaaa_query ():
305310 """Test that queries for AAAA records work."""
306311 zc = Zeroconf (interfaces = ['127.0.0.1' ])
@@ -326,6 +331,8 @@ def test_aaaa_query():
326331 zc .close ()
327332
328333
334+ @unittest .skipIf (not has_working_ipv6 (), 'Requires IPv6' )
335+ @unittest .skipIf (os .environ .get ('SKIP_IPV6' ), 'IPv6 tests disabled' )
329336def test_a_and_aaaa_record_fate_sharing ():
330337 """Test that queries for AAAA always return A records in the additionals."""
331338 zc = Zeroconf (interfaces = ['127.0.0.1' ])
0 commit comments