summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r--Lib/test/test_asyncio/test_events.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 58e94d4..aefa33b 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -852,6 +852,16 @@ class EventLoopTestsMixin:
self.test_connect_accepted_socket(server_context, client_context)
+ def test_connect_accepted_socket_ssl_timeout_for_plain_socket(self):
+ sock = socket.socket()
+ self.addCleanup(sock.close)
+ coro = self.loop.connect_accepted_socket(
+ MyProto, sock, ssl_handshake_timeout=1)
+ with self.assertRaisesRegex(
+ ValueError,
+ 'ssl_handshake_timeout is only meaningful with ssl'):
+ self.loop.run_until_complete(coro)
+
@mock.patch('asyncio.base_events.socket')
def create_server_multiple_hosts(self, family, hosts, mock_sock):
@asyncio.coroutine