Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
mark failing tests of test_socket
  • Loading branch information
youknowone committed Mar 30, 2025
commit 9e2f6bd1875419fa3add740b89db3cdad988fe15
18 changes: 14 additions & 4 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,8 @@ def requireSocket(*args):

class GeneralModuleTests(unittest.TestCase):

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.skipUnless(_socket is not None, 'need _socket module')
def test_socket_type(self):
self.assertTrue(gc.is_tracked(_socket.socket))
Expand Down Expand Up @@ -1532,8 +1534,6 @@ def test_sio_loopback_fast_path(self):
raise
self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)

# TODO: RUSTPYTHON, AssertionError: '2' != 'AddressFamily.AF_INET'
@unittest.expectedFailure
def testGetaddrinfo(self):
try:
socket.getaddrinfo('localhost', 80)
Expand Down Expand Up @@ -1615,6 +1615,8 @@ def testGetaddrinfo(self):
except socket.gaierror:
pass

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_getaddrinfo_int_port_overflow(self):
# gh-74895: Test that getaddrinfo does not raise OverflowError on port.
#
Expand Down Expand Up @@ -1894,8 +1896,6 @@ def test_getnameinfo_ipv6_scopeid_numeric(self):
nameinfo = socket.getnameinfo(sockaddr, socket.NI_NUMERICHOST | socket.NI_NUMERICSERV)
self.assertEqual(nameinfo, ('ff02::1de:c0:face:8d%' + str(ifindex), '1234'))

# TODO: RUSTPYTHON, AssertionError: '2' != 'AddressFamily.AF_INET'
@unittest.expectedFailure
def test_str_for_enums(self):
# Make sure that the AF_* and SOCK_* constants have enum-like string
# reprs.
Expand Down Expand Up @@ -2052,6 +2052,8 @@ def test_socket_fileno_requires_socket_fd(self):
fileno=afile.fileno())
self.assertEqual(cm.exception.errno, errno.ENOTSOCK)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_addressfamily_enum(self):
import _socket, enum
CheckedAddressFamily = enum._old_convert_(
Expand All @@ -2061,6 +2063,8 @@ def test_addressfamily_enum(self):
)
enum._test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_socketkind_enum(self):
import _socket, enum
CheckedSocketKind = enum._old_convert_(
Expand All @@ -2070,6 +2074,8 @@ def test_socketkind_enum(self):
)
enum._test_simple_enum(CheckedSocketKind, socket.SocketKind)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_msgflag_enum(self):
import _socket, enum
CheckedMsgFlag = enum._old_convert_(
Expand All @@ -2079,6 +2085,8 @@ def test_msgflag_enum(self):
)
enum._test_simple_enum(CheckedMsgFlag, socket.MsgFlag)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_addressinfo_enum(self):
import _socket, enum
CheckedAddressInfo = enum._old_convert_(
Expand Down Expand Up @@ -5352,6 +5360,8 @@ def test_create_connection(self):
expected_errnos = socket_helper.get_socket_conn_refused_errs()
self.assertIn(cm.exception.errno, expected_errnos)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_create_connection_all_errors(self):
port = socket_helper.find_unused_port()
try:
Expand Down
Loading