[Python-checkins] cpython: test_poplib: skip stls_context test when SNI is not available

christian.heimes python-checkins at python.org
Sun Dec 15 21:44:52 CET 2013


http://hg.python.org/cpython/rev/c00c1715d599
changeset:   87971:c00c1715d599
user:        Christian Heimes <christian at cheimes.de>
date:        Sun Dec 15 21:44:43 2013 +0100
summary:
  test_poplib: skip stls_context test when SNI is not available

files:
  Lib/test/test_poplib.py |  5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -21,10 +21,14 @@
 SUPPORTS_SSL = False
 if hasattr(poplib, 'POP3_SSL'):
     import ssl
+    from ssl import HAS_SNI
 
     SUPPORTS_SSL = True
     CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert3.pem")
     CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "pycacert.pem")
+else:
+    HAS_SNI = False
+
 requires_ssl = skipUnless(SUPPORTS_SSL, 'SSL not supported')
 
 # the dummy data returned by server when LIST and RETR commands are issued
@@ -330,6 +334,7 @@
         self.assertEqual(resp, expected)
 
     @requires_ssl
+    @skipUnless(HAS_SNI, 'No SNI support in ssl module')
     def test_stls_context(self):
         expected = b'+OK Begin TLS negotiation'
         ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list