From 02bf701b25b6519422c12dd546be348abe07f032 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Sat, 2 Mar 2013 14:25:56 +0200 Subject: #17333: test_imaplib now works with unittest test discovery. Patch by Zachary Ware. --- Lib/test/test_imaplib.py | 6 +++--- Misc/NEWS | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index 4b12d23..7db3f7d 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -444,7 +444,7 @@ class RemoteIMAP_SSLTest(RemoteIMAPTest): keyfile=CERTFILE, ssl_context=self.create_ssl_context()) -def test_main(): +def load_tests(*args): tests = [TestImaplib] if support.is_resource_enabled('network'): @@ -459,9 +459,9 @@ def test_main(): RemoteIMAPTest, RemoteIMAP_SSLTest, RemoteIMAP_STARTTLSTest, ]) - support.run_unittest(*tests) + return unittest.TestSuite([unittest.makeSuite(test) for test in tests]) if __name__ == "__main__": support.use_resources = ['network'] - test_main() + unittest.main() diff --git a/Misc/NEWS b/Misc/NEWS index 91c4153..83c38ec 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -644,6 +644,9 @@ Tests - Issue #15539: Added regression tests for Tools/scripts/pindent.py. +- Issue #17333: test_imaplib now works with unittest test discovery. + Patch by Zachary Ware. + - Issue #17082: test_dbm* now work with unittest test discovery. Patch by Zachary Ware. -- cgit v0.12