diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py index fd28725e804189..b20e4bce17c27c 100644 --- a/Lib/test/test_asyncio/test_selector_events.py +++ b/Lib/test/test_asyncio/test_selector_events.py @@ -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() @@ -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