summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2018-01-30 07:55:46 (GMT)
committerGitHub <noreply@github.com>2018-01-30 07:55:46 (GMT)
commit2e0ecde8d74f5fc0e3e3e39216975cc70efc4796 (patch)
tree92551c43cae0827dab8c40362ae3d5a2f091520e /Lib/test/test_socket.py
parentdd42cb71f2cb02f3a32f016137b12a146bc0d0e2 (diff)
downloadcpython-2e0ecde8d74f5fc0e3e3e39216975cc70efc4796.zip
cpython-2e0ecde8d74f5fc0e3e3e39216975cc70efc4796.tar.gz
cpython-2e0ecde8d74f5fc0e3e3e39216975cc70efc4796.tar.bz2
bpo-28134: Ignore proto in unknown socket test (GH-5435)
Band-aid for macOS: Some platforms seem to ignore unknown protocols. Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 89cf1fa..2851922 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1618,7 +1618,7 @@ class GeneralModuleTests(unittest.TestCase):
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.
#
@@ -1642,7 +1642,8 @@ class GeneralModuleTests(unittest.TestCase):
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):