Skip to content

Commit

Permalink
skip test if sendmsg does not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 authored Oct 24, 2022
1 parent 2725334 commit bed096d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/test/test_asyncio/test_selector_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ def test_write_sendmsg_no_data(self):
self.assertFalse(self.sock.sendmsg.called)
self.assertEqual(list_to_buffer([b'data']), transport._buffer)

@unittest.skipUnless(hasattr(socket.socket, 'sendmsg'), 'no sendmsg')
def test_write_sendmsg_full(self):
data = memoryview(b'data')
self.sock.sendmsg = mock.Mock()
Expand All @@ -758,7 +759,9 @@ def test_write_sendmsg_full(self):
self.assertTrue(self.sock.sendmsg.called)
self.assertFalse(self.loop.writers)

@unittest.skipUnless(hasattr(socket.socket, 'sendmsg'), 'no sendmsg')
def test_write_sendmsg_partial(self):

data = memoryview(b'data')
self.sock.sendmsg = mock.Mock()
# Sent partial data
Expand Down

0 comments on commit bed096d

Please sign in to comment.