]> granicus.if.org Git - python/commitdiff
Fix tests: getsockname() can return None on OS X on unbound sockets (#1400)
authorAntoine Pitrou <pitrou@free.fr>
Tue, 2 May 2017 21:48:26 +0000 (23:48 +0200)
committerGitHub <noreply@github.com>
Tue, 2 May 2017 21:48:26 +0000 (23:48 +0200)
Lib/test/test_socket.py

index 5e37fc608f26ad2323701c287fa1490fa6a8ee20..f28f7d6816e925315ae02f581faee3d882891feb 100644 (file)
@@ -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.