mirror of
https://github.com/python/cpython.git
synced 2025-11-19 02:39:15 +00:00
Merge 3.4 (asyncio)
This commit is contained in:
commit
2647375cc9
10 changed files with 104 additions and 10 deletions
|
|
@ -499,8 +499,12 @@ class BaseProactorEventLoopTests(test_utils.TestCase):
|
|||
self.proactor.accept.assert_called_with(self.sock)
|
||||
|
||||
def test_socketpair(self):
|
||||
class EventLoop(BaseProactorEventLoop):
|
||||
# override the destructor to not log a ResourceWarning
|
||||
def __del__(self):
|
||||
pass
|
||||
self.assertRaises(
|
||||
NotImplementedError, BaseProactorEventLoop, self.proactor)
|
||||
NotImplementedError, EventLoop, self.proactor)
|
||||
|
||||
def test_make_socket_transport(self):
|
||||
tr = self.loop._make_socket_transport(self.sock, asyncio.Protocol())
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ class SslProtoHandshakeTests(test_utils.TestCase):
|
|||
def ssl_protocol(self, waiter=None):
|
||||
sslcontext = test_utils.dummy_ssl_context()
|
||||
app_proto = asyncio.Protocol()
|
||||
return sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter)
|
||||
proto = sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter)
|
||||
self.addCleanup(proto._app_transport.close)
|
||||
return proto
|
||||
|
||||
def connection_made(self, ssl_proto, do_handshake=None):
|
||||
transport = mock.Mock()
|
||||
|
|
@ -56,9 +58,6 @@ class SslProtoHandshakeTests(test_utils.TestCase):
|
|||
with test_utils.disable_logger():
|
||||
self.loop.run_until_complete(handshake_fut)
|
||||
|
||||
# Close the transport
|
||||
ssl_proto._app_transport.close()
|
||||
|
||||
def test_eof_received_waiter(self):
|
||||
waiter = asyncio.Future(loop=self.loop)
|
||||
ssl_proto = self.ssl_protocol(waiter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue