summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-27 11:07:10 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-01-27 11:07:10 +0100
commit3fb21be1bbadc5aa2fe4dccfd4df4cf2cb507441 (patch)
treef22e69fe29c4ca2350e0bfd613983f3b5fa4bfa3
parent25969654992d4208c0941f37e13e26d61381ccdc (diff)
downloadtrollius-3fb21be1bbadc5aa2fe4dccfd4df4cf2cb507441.tar.gz
test_sslproto: skip test if ssl module is missing
-rw-r--r--tests/test_sslproto.py5
1 files changed, 5 insertions, 0 deletions
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