Skip to content

Commit

Permalink
bpo-28134: Ignore proto in unknown socket test (GH-5435)
Browse files Browse the repository at this point in the history
Band-aid for macOS: Some platforms seem to ignore unknown protocols.

Signed-off-by: Christian Heimes <[email protected]>
  • Loading branch information
tiran authored Jan 30, 2018
1 parent dd42cb7 commit 2e0ecde
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ def test_socket_consistent_sock_type(self):
self.assertEqual(s.type, socket.SOCK_STREAM)

@unittest.skipIf(os.name == 'nt', 'Will not work on Windows')
def test_uknown_socket_family_repr(self):
def test_unknown_socket_family_repr(self):
# Test that when created with a family that's not one of the known
# AF_*/SOCK_* constants, socket.family just returns the number.
#
Expand All @@ -1642,7 +1642,8 @@ def test_uknown_socket_family_repr(self):
fileno=fd) as s:
self.assertEqual(s.family, unknown_family)
self.assertEqual(s.type, unknown_type)
self.assertEqual(s.proto, 23)
# some OS like macOS ignore proto
self.assertIn(s.proto, {0, 23})

@unittest.skipUnless(hasattr(os, 'sendfile'), 'test needs os.sendfile()')
def test__sendfile_use_sendfile(self):
Expand Down

0 comments on commit 2e0ecde

Please sign in to comment.