summaryrefslogtreecommitdiff
path: root/netaddr/tests/ip/test_platform_osx.py
diff options
context:
space:
mode:
Diffstat (limited to 'netaddr/tests/ip/test_platform_osx.py')
-rw-r--r--netaddr/tests/ip/test_platform_osx.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/netaddr/tests/ip/test_platform_osx.py b/netaddr/tests/ip/test_platform_osx.py
index 264005d..c28bceb 100644
--- a/netaddr/tests/ip/test_platform_osx.py
+++ b/netaddr/tests/ip/test_platform_osx.py
@@ -1,3 +1,5 @@
+import platform
+
import pytest
from netaddr import iprange_to_cidrs, IPNetwork, IPAddress, INET_PTON, AddrFormatError
@@ -71,9 +73,13 @@ def test_ip_behaviour_osx():
IPNetwork('::255.255.255.254/128'),
]
- # inet_pton has to be different on Mac OSX *sigh*
+ # inet_pton has to be different on Mac OSX *sigh*...
assert IPAddress('010.000.000.001', flags=INET_PTON) == IPAddress('10.0.0.1')
- assert int_to_str(0xffff) == '::0.0.255.255'
+ # ...but at least Apple changed inet_ntop in Mac OS 10.15 (Catalina) so it's compatible with Linux
+ if platform.mac_ver()[0] >= '10.15':
+ assert int_to_str(0xffff) == '::ffff'
+ else:
+ assert int_to_str(0xffff) == '::0.0.255.255'
@pytest.mark.skipif('sys.platform == "darwin"')