[Python-checkins] cpython (3.3): #17333: test_imaplib now works with unittest test discovery. Patch by Zachary

ezio.melotti python-checkins at python.org
Sat Mar 2 13:33:25 CET 2013


http://hg.python.org/cpython/rev/02bbc5375a56
changeset: 82454:02bbc5375a56
branch: 3.3
parent: 82452:80bcc98bf939
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Sat Mar 02 14:25:56 2013 +0200
summary:
 #17333: test_imaplib now works with unittest test discovery. Patch by Zachary Ware.
files:
 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
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -444,7 +444,7 @@
 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 @@
 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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -644,6 +644,9 @@
 
 - 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.
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /