summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2024-02-05 00:04:57 (GMT)
committerGitHub <noreply@github.com>2024-02-05 00:04:57 (GMT)
commit391659b3da570bfa28fed5fbdb6f2d9c26ab3dd0 (patch)
tree19d4bd5693a55e06e3ab4a88826e284a1e9717ae /Lib/test/test_socket.py
parent15f6f048a6ecdf0f6f4fc076d013be3d110f8ed6 (diff)
downloadcpython-391659b3da570bfa28fed5fbdb6f2d9c26ab3dd0.zip
cpython-391659b3da570bfa28fed5fbdb6f2d9c26ab3dd0.tar.gz
cpython-391659b3da570bfa28fed5fbdb6f2d9c26ab3dd0.tar.bz2
gh-114099: Add test exclusions to support running the test suite on iOS (#114889)
Add test annotations required to run the test suite on iOS (PEP 730). The majority of the change involve annotating tests that use subprocess, but are skipped on Emscripten/WASI for other reasons, and including iOS/tvOS/watchOS under the same umbrella as macOS/darwin checks. `is_apple` and `is_apple_mobile` test helpers have been added to identify *any* Apple platform, and "any Apple platform except macOS", respectively.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 231448c..1796423 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1,9 +1,8 @@
import unittest
from test import support
-from test.support import os_helper
-from test.support import socket_helper
-from test.support import threading_helper
-from test.support import refleak_helper
+from test.support import (
+ is_apple, os_helper, refleak_helper, socket_helper, threading_helper
+)
import _thread as thread
import array
@@ -1196,8 +1195,11 @@ class GeneralModuleTests(unittest.TestCase):
# Find one service that exists, then check all the related interfaces.
# I've ordered this by protocols that have both a tcp and udp
# protocol, at least for modern Linuxes.
- if (sys.platform.startswith(('freebsd', 'netbsd', 'gnukfreebsd'))
- or sys.platform in ('linux', 'darwin')):
+ if (
+ sys.platform.startswith(('freebsd', 'netbsd', 'gnukfreebsd'))
+ or sys.platform == 'linux'
+ or is_apple
+ ):
# avoid the 'echo' service on this platform, as there is an
# assumption breaking non-standard port/protocol entry
services = ('daytime', 'qotd', 'domain')
@@ -3708,7 +3710,7 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
def _testFDPassCMSG_LEN(self):
self.createAndSendFDs(1)
- @unittest.skipIf(sys.platform == "darwin", "skipping, see issue #12958")
+ @unittest.skipIf(is_apple, "skipping, see issue #12958")
@unittest.skipIf(AIX, "skipping, see issue #22397")
@requireAttrs(socket, "CMSG_SPACE")
def testFDPassSeparate(self):
@@ -3719,7 +3721,7 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
maxcmsgs=2)
@testFDPassSeparate.client_skip
- @unittest.skipIf(sys.platform == "darwin", "skipping, see issue #12958")
+ @unittest.skipIf(is_apple, "skipping, see issue #12958")
@unittest.skipIf(AIX, "skipping, see issue #22397")
def _testFDPassSeparate(self):
fd0, fd1 = self.newFDs(2)
@@ -3732,7 +3734,7 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
array.array("i", [fd1]))]),
len(MSG))
- @unittest.skipIf(sys.platform == "darwin", "skipping, see issue #12958")
+ @unittest.skipIf(is_apple, "skipping, see issue #12958")
@unittest.skipIf(AIX, "skipping, see issue #22397")
@requireAttrs(socket, "CMSG_SPACE")
def testFDPassSeparateMinSpace(self):
@@ -3746,7 +3748,7 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
maxcmsgs=2, ignoreflags=socket.MSG_CTRUNC)
@testFDPassSeparateMinSpace.client_skip
- @unittest.skipIf(sys.platform == "darwin", "skipping, see issue #12958")
+ @unittest.skipIf(is_apple, "skipping, see issue #12958")
@unittest.skipIf(AIX, "skipping, see issue #22397")
def _testFDPassSeparateMinSpace(self):
fd0, fd1 = self.newFDs(2)
@@ -3770,7 +3772,7 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
nbytes = self.sendmsgToServer([msg])
self.assertEqual(nbytes, len(msg))
- @unittest.skipIf(sys.platform == "darwin", "see issue #24725")
+ @unittest.skipIf(is_apple, "skipping, see issue #12958")
def testFDPassEmpty(self):
# Try to pass an empty FD array. Can receive either no array
# or an empty array.