changeset: 95411:7a91363f31e1 branch: 3.4 parent: 95406:c3e7a670dda2 user: Serhiy Storchaka date: Fri Apr 03 15:02:20 2015 +0300 files: Lib/test/test_nntplib.py description: Issue #22351. MockSslTests tests in test_nntplib now are reported if skipped. diff -r c3e7a670dda2 -r 7a91363f31e1 Lib/test/test_nntplib.py --- a/Lib/test/test_nntplib.py Fri Apr 03 11:06:40 2015 +0200 +++ b/Lib/test/test_nntplib.py Fri Apr 03 15:02:20 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__":