[Python-checkins] cpython (merge 3.4 -> default): Merge 3.4 (test_nntplib)
victor.stinner
python-checkins at python.org
Fri Apr 3 11:09:42 CEST 2015
https://hg.python.org/cpython/rev/f80d5faa60ee
changeset: 95407:f80d5faa60ee
parent: 95404:846c165cf643
parent: 95406:c3e7a670dda2
user: Victor Stinner <victor.stinner at gmail.com>
date: Fri Apr 03 11:09:08 2015 +0200
summary:
Merge 3.4 (test_nntplib)
files:
Lib/test/test_nntplib.py | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -1509,15 +1509,16 @@
Handler, nntplib.NNTPPermanentError, authinfo_response,
login, password)
- at unittest.skipUnless(ssl, 'requires SSL support')
-class MockSslTests(MockSocketTests):
- class nntp_class(nntplib.NNTP_SSL):
- def __init__(self, *pos, **kw):
- class bypass_context:
- """Bypass encryption and actual SSL module"""
- def wrap_socket(sock, **args):
- return sock
- return super().__init__(*pos, ssl_context=bypass_context, **kw)
+if ssl is not None:
+ class MockSslTests(MockSocketTests):
+ class nntp_class(nntplib.NNTP_SSL):
+ def __init__(self, *pos, **kw):
+ class bypass_context:
+ """Bypass encryption and actual SSL module"""
+ def wrap_socket(sock, **args):
+ return sock
+ return super().__init__(*pos, ssl_context=bypass_context, **kw)
+
if __name__ == "__main__":
unittest.main()
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list