]> granicus.if.org Git - python/commitdiff
Skip some tests that require server name indication (SNI)
authorChristian Heimes <christian@cheimes.de>
Sun, 15 Dec 2013 16:02:36 +0000 (17:02 +0100)
committerChristian Heimes <christian@cheimes.de>
Sun, 15 Dec 2013 16:02:36 +0000 (17:02 +0100)
Lib/test/test_asyncio/test_events.py

index 0c6b0fe3ef4a3b0aac8a02e201304147a83ce0bf..c6db4d1bc38a3c65477d0fb57e4718d3f4867b34 100644 (file)
@@ -10,6 +10,9 @@ try:
     import ssl
 except ImportError:
     ssl = None
+    HAS_SNI = False
+else:
+    from ssl import HAS_SNI
 import subprocess
 import sys
 import threading
@@ -666,6 +669,7 @@ class EventLoopTestsMixin:
         server.close()
 
     @unittest.skipIf(ssl is None, 'No ssl module')
+    @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
     def test_create_server_ssl_verify_failed(self):
         proto = None
 
@@ -694,6 +698,7 @@ class EventLoopTestsMixin:
         server.close()
 
     @unittest.skipIf(ssl is None, 'No ssl module')
+    @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
     def test_create_server_ssl_match_failed(self):
         proto = None
 
@@ -724,6 +729,7 @@ class EventLoopTestsMixin:
         server.close()
 
     @unittest.skipIf(ssl is None, 'No ssl module')
+    @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
     def test_create_server_ssl_verified(self):
         proto = None