From 3fb21be1bbadc5aa2fe4dccfd4df4cf2cb507441 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 27 Jan 2015 11:07:10 +0100 Subject: test_sslproto: skip test if ssl module is missing --- tests/test_sslproto.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_sslproto.py b/tests/test_sslproto.py index 812dedb..b1a61c4 100644 --- a/tests/test_sslproto.py +++ b/tests/test_sslproto.py @@ -2,6 +2,10 @@ import unittest from unittest import mock +try: + import ssl +except ImportError: + ssl = None import asyncio from asyncio import sslproto @@ -14,6 +18,7 @@ class SslProtoHandshakeTests(test_utils.TestCase): self.loop = asyncio.new_event_loop() self.set_event_loop(self.loop) + @unittest.skipIf(ssl is None, 'No ssl module') def test_cancel_handshake(self): # Python issue #23197: cancelling an handshake must not raise an # exception or log an error, even if the handshake failed -- cgit v1.2.1