gh-95174: WASI: skip missing sockets functions (GH-95179)

This commit is contained in:
Christian Heimes 2022-07-27 08:19:23 +02:00 committed by GitHub
parent daa64d6a59
commit 8b24d60f1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 864 additions and 27 deletions

View file

@ -965,6 +965,19 @@ class GeneralModuleTests(unittest.TestCase):
socket.IPPROTO_L2TP
socket.IPPROTO_SCTP
@unittest.skipIf(support.is_wasi, "WASI is missing these methods")
def test_socket_methods(self):
# socket methods that depend on a configure HAVE_ check. They should
# be present on all platforms except WASI.
names = [
"_accept", "bind", "connect", "connect_ex", "getpeername",
"getsockname", "listen", "recvfrom", "recvfrom_into", "sendto",
"setsockopt", "shutdown"
]
for name in names:
if not hasattr(socket.socket, name):
self.fail(f"socket method {name} is missing")
@unittest.skipUnless(sys.platform == 'darwin', 'macOS specific test')
@unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test')
def test3542SocketOptions(self):