From: Antoine Pitrou Date: Tue, 2 May 2017 21:48:26 +0000 (+0200) Subject: Fix tests: getsockname() can return None on OS X on unbound sockets (#1400) X-Git-Tag: v3.7.0a1~871 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0360a9d015ddbc4e3d58e3ab4b433da27bf1db3a;p=thirdparty%2FPython%2Fcpython.git Fix tests: getsockname() can return None on OS X on unbound sockets (#1400) --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 5e37fc608f26..f28f7d6816e9 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4683,8 +4683,8 @@ class TestUnixDomain(unittest.TestCase): 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.