changeset: 95412:c935c1e1d001 parent: 95410:753233baf27e parent: 95411:7a91363f31e1 user: Serhiy Storchaka date: Fri Apr 03 15:02:40 2015 +0300 description: Issue #22351. MockSslTests tests in test_nntplib now are reported if skipped. diff -r 753233baf27e -r c935c1e1d001 Lib/test/test_nntplib.py --- a/Lib/test/test_nntplib.py Thu Apr 02 21:28:28 2015 +0200 +++ b/Lib/test/test_nntplib.py Fri Apr 03 15:02:40 2015 +0300 @@ -1509,15 +1509,16 @@ Handler, nntplib.NNTPPermanentError, authinfo_response, login, password) -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) +class bypass_context: + """Bypass encryption and actual SSL module""" + def wrap_socket(sock, **args): + return sock + +@unittest.skipUnless(ssl, 'requires SSL support') +class MockSslTests(MockSocketTests): + @staticmethod + def nntp_class(*pos, **kw): + return nntplib.NNTP_SSL(*pos, ssl_context=bypass_context, **kw) if __name__ == "__main__":