Skip to content

Commit c423723

Browse files
GalaxySnailpicnixz
andauthored
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 4f8d1ca commit c423723

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_socket.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7349,7 +7349,7 @@ def _recv_one_fd(sock, bufsize, flags=0):
73497349
max_fds = 1
73507350
return socket.recv_fds(sock, bufsize, max_fds, flags)
73517351

7352-
def testSendAndRecvFds(self):
7352+
def test_send_and_recv_fds(self):
73537353
# send 10 file descriptors
73547354
pipes = [os.pipe() for _ in range(10)]
73557355
self._cleanup_fds(fd for pair in pipes for fd in pair)
@@ -7369,7 +7369,7 @@ def testSendAndRecvFds(self):
73697369
# don't test addr
73707370

73717371
# test that file descriptors are connected
7372-
for index, ((_, wfd), rfd) in enumerate(zip(pipes, fds2)):
7372+
for index, ((_, wfd), rfd) in enumerate(zip(pipes, fds2, strict=True)):
73737373
self._test_pipe(rfd, wfd, str(index).encode())
73747374

73757375
def test_send_recv_fds_with_addrs(self):
@@ -7412,6 +7412,7 @@ def test_recv_fds_peek(self):
74127412

74137413
# peek message on sock2
74147414
peek_len = len(MSG) // 2
7415+
self.assertGreater(peek_len, 0)
74157416
msg, fds, flags, addr = socket.recv_fds(sock2, peek_len, 1,
74167417
flags=socket.MSG_PEEK)
74177418
self._cleanup_fds(fds)

0 commit comments

Comments
 (0)