bpo-32154: Remove asyncio.windows_utils.socketpair (#4609)

This commit is contained in:
Victor Stinner 2017-11-28 21:33:20 +01:00 committed by GitHub
parent 4d193bcc25
commit ac577d7d0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 21 additions and 123 deletions

View file

@ -363,7 +363,7 @@ class EventLoopTestsMixin:
self.assertNotEqual(thread_id, threading.get_ident())
def test_reader_callback(self):
r, w = test_utils.socketpair()
r, w = socket.socketpair()
r.setblocking(False)
bytes_read = bytearray()
@ -391,7 +391,7 @@ class EventLoopTestsMixin:
self.assertEqual(bytes_read, b'abcdef')
def test_writer_callback(self):
r, w = test_utils.socketpair()
r, w = socket.socketpair()
w.setblocking(False)
def writer(data):
@ -1568,7 +1568,7 @@ class EventLoopTestsMixin:
@unittest.skipUnless(sys.platform != 'win32',
"Don't support pipes for Windows")
def test_write_pipe_disconnect_on_close(self):
rsock, wsock = test_utils.socketpair()
rsock, wsock = socket.socketpair()
rsock.setblocking(False)
pipeobj = io.open(wsock.detach(), 'wb', 1024)
@ -1706,7 +1706,7 @@ class EventLoopTestsMixin:
self.assertEqual('CLOSED', write_proto.state)
def test_prompt_cancellation(self):
r, w = test_utils.socketpair()
r, w = socket.socketpair()
r.setblocking(False)
f = self.loop.sock_recv(r, 1)
ov = getattr(f, 'ov', None)
@ -1771,7 +1771,7 @@ class EventLoopTestsMixin:
def test_remove_fds_after_closing(self):
loop = self.create_event_loop()
callback = lambda: None
r, w = test_utils.socketpair()
r, w = socket.socketpair()
self.addCleanup(r.close)
self.addCleanup(w.close)
loop.add_reader(r, callback)
@ -1783,7 +1783,7 @@ class EventLoopTestsMixin:
def test_add_fds_after_closing(self):
loop = self.create_event_loop()
callback = lambda: None
r, w = test_utils.socketpair()
r, w = socket.socketpair()
self.addCleanup(r.close)
self.addCleanup(w.close)
loop.close()