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

ezio.melotti python-checkins at python.org
Sat Mar 23 15:37:16 CET 2013


http://hg.python.org/cpython/rev/fa9e189e30ad
changeset:   82903:fa9e189e30ad
branch:      3.3
parent:      82901:459ce02c4823
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sat Mar 23 16:30:16 2013 +0200
summary:
  #17479: test_io now works with unittest test discovery.  Patch by Zachary Ware.

files:
  Lib/test/test_io.py |  7 ++++---
  Misc/NEWS           |  3 +++
  2 files changed, 7 insertions(+), 3 deletions(-)


diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -3226,7 +3226,7 @@
     test_reentrant_write_text = None
 
 
-def test_main():
+def load_tests(*args):
     tests = (CIOTest, PyIOTest,
              CBufferedReaderTest, PyBufferedReaderTest,
              CBufferedWriterTest, PyBufferedWriterTest,
@@ -3259,7 +3259,8 @@
             for name, obj in py_io_ns.items():
                 setattr(test, name, obj)
 
-    support.run_unittest(*tests)
+    suite = unittest.TestSuite([unittest.makeSuite(test) for test in tests])
+    return suite
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -714,6 +714,9 @@
 
 - Issue #15539: Added regression tests for Tools/scripts/pindent.py.
 
+- Issue #17479: test_io now works with unittest test discovery.
+  Patch by Zachary Ware.
+
 - Issue #17066: test_robotparser now works with unittest test discovery.
   Patch by Zachary Ware.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list