diff options
author | Yury Selivanov <yury@magic.io> | 2018-10-02 17:53:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 17:53:06 (GMT) |
commit | 9012a0fb4c4ec1afef9efb9fdb0964554ea17983 (patch) | |
tree | 87ff02fec1fa16d87b30e8b1028e71ea624b5b48 /Lib/test/test_asyncio/test_sslproto.py | |
parent | 11c4eaa99362f91c7faea88e31df3e46af020023 (diff) | |
download | cpython-9012a0fb4c4ec1afef9efb9fdb0964554ea17983.zip cpython-9012a0fb4c4ec1afef9efb9fdb0964554ea17983.tar.gz cpython-9012a0fb4c4ec1afef9efb9fdb0964554ea17983.tar.bz2 |
bpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661)
Diffstat (limited to 'Lib/test/test_asyncio/test_sslproto.py')
-rw-r--r-- | Lib/test/test_asyncio/test_sslproto.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 8182671..39b19dd 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -252,7 +252,7 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin): self.on_eof.set_result(True) async def client(addr): - await asyncio.sleep(0.5, loop=self.loop) + await asyncio.sleep(0.5) on_data = self.loop.create_future() on_eof = self.loop.create_future() @@ -271,7 +271,7 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin): with self.tcp_server(serve, timeout=self.TIMEOUT) as srv: self.loop.run_until_complete( - asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10)) + asyncio.wait_for(client(srv.addr), timeout=10)) def test_start_tls_client_buf_proto_1(self): HELLO_MSG = b'1' * self.PAYLOAD_SIZE @@ -332,7 +332,7 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin): self.on_eof.set_result(True) async def client(addr): - await asyncio.sleep(0.5, loop=self.loop) + await asyncio.sleep(0.5) on_data1 = self.loop.create_future() on_data2 = self.loop.create_future() @@ -362,7 +362,7 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin): with self.tcp_server(serve, timeout=self.TIMEOUT) as srv: self.loop.run_until_complete( asyncio.wait_for(client(srv.addr), - loop=self.loop, timeout=self.TIMEOUT)) + timeout=self.TIMEOUT)) def test_start_tls_slow_client_cancel(self): HELLO_MSG = b'1' * self.PAYLOAD_SIZE @@ -403,7 +403,7 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin): self.on_eof.set_result(True) async def client(addr): - await asyncio.sleep(0.5, loop=self.loop) + await asyncio.sleep(0.5) on_data = self.loop.create_future() on_eof = self.loop.create_future() @@ -418,12 +418,11 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin): with self.assertRaises(asyncio.TimeoutError): await asyncio.wait_for( self.loop.start_tls(tr, proto, client_context), - 0.5, - loop=self.loop) + 0.5) with self.tcp_server(serve, timeout=self.TIMEOUT) as srv: self.loop.run_until_complete( - asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10)) + asyncio.wait_for(client(srv.addr), timeout=10)) def test_start_tls_server_1(self): HELLO_MSG = b'1' * self.PAYLOAD_SIZE @@ -496,7 +495,7 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin): timeout=self.TIMEOUT): await asyncio.wait_for( main(proto, on_con, on_eof, on_con_lost), - loop=self.loop, timeout=self.TIMEOUT) + timeout=self.TIMEOUT) server.close() await server.wait_closed() @@ -541,8 +540,7 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin): ssl=client_sslctx, server_hostname='', ssl_handshake_timeout=10.0), - 0.5, - loop=self.loop) + 0.5) with self.tcp_server(server, max_clients=1, |