10000 test_sslproto: skip test if ssl module is missing · python/asyncio@8343733 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit 8343733

Browse files
committed
test_sslproto: skip test if ssl module is missing
1 parent f1774fc commit 8343733

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_sslproto.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
import unittest
44
from unittest import mock
5+
try:
6+
import ssl
7+
except ImportError:
8+
ssl = None
59

610
import asyncio
711
from asyncio import sslproto
@@ -14,6 +18,7 @@ def setUp(self):
1418
self.loop = asyncio.new_event_loop()
1519
self.set_event_loop(self.loop)
1620

21+
@unittest.skipIf(ssl is None, 'No ssl module')
1722
def test_cancel_handshake(self):
1823
# Python issue #23197: cancelling an handshake must not raise an
1924
# exception or log an error, even if the handshake failed

0 commit comments

Comments
 (0)
0