#17333: test_imaplib now works with unittest test discovery. Patch by Zachary Ware.
authorEzio Melotti <ezio.melotti@gmail.com>
Sat, 2 Mar 2013 12:25:56 +0000 (14:25 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Sat, 2 Mar 2013 12:25:56 +0000 (14:25 +0200)
Lib/test/test_imaplib.py
Misc/NEWS

index 4b12d23314f8f83a4ebf465474fd9a8401e85e4d..7db3f7dddc1d5302e31adea735b6301175c60ed6 100644 (file)
@@ -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()
index 91c415344f0691118dc91e44bb1a85442f81d4fa..83c38ec92a927efc142d5178cdea3922e10e9525 100644 (file)
--- 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.