From b952b4a57ab8357c8852d7f6e8dd0ce88aa6349a Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 2 May 2017 23:31:54 +0200 Subject: [PATCH] Fix tests: getsockname() can return None on OS X on unbound sockets --- Lib/test/test_socket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 5e37fc608f26ad..f28f7d6816e925 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4683,8 +4683,8 @@ def bind(self, sock, path): raise def testUnbound(self): - # Issue #30205 - self.assertEqual(self.sock.getsockname(), '') + # Issue #30205 (note getsockname() can return None on OS X) + self.assertIn(self.sock.getsockname(), ('', None)) def testStrAddr(self): # Test binding to and retrieving a normal string pathname.