summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-12-15 18:38:22 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-12-15 18:38:22 (GMT)
commite7945d76ff1c8927b94e2cc012936326a9d92e60 (patch)
tree3674cc4316ed817023f130d6b830fb3299187541 /Lib
parenta5f0eda91ade2f764c3e06d1eb728a95d40dd524 (diff)
downloadcpython-e7945d76ff1c8927b94e2cc012936326a9d92e60.zip
cpython-e7945d76ff1c8927b94e2cc012936326a9d92e60.tar.gz
cpython-e7945d76ff1c8927b94e2cc012936326a9d92e60.tar.bz2
test_ftplib: skip check_hostname test when SNI is not available
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ftplib.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 15458a8..7f3bebf 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -15,6 +15,9 @@ try:
import ssl
except ImportError:
ssl = None
+ HAS_SNI = False
+else:
+ from ssl import HAS_SNI
from unittest import TestCase, skipUnless
from test import support
@@ -924,6 +927,7 @@ class TestTLS_FTPClass(TestCase):
self.client.ccc()
self.assertRaises(ValueError, self.client.sock.unwrap)
+ @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
def test_check_hostname(self):
self.client.quit()
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)