From: Ezio Melotti Date: Sat, 23 Mar 2013 14:30:16 +0000 (+0200) Subject: #17479: test_io now works with unittest test discovery. Patch by Zachary Ware. X-Git-Tag: v3.3.1rc1~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=daa42c778e101fa158f89e3a8c5418be5eef90c6;p=thirdparty%2FPython%2Fcpython.git #17479: test_io now works with unittest test discovery. Patch by Zachary Ware. --- diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 64c66d886733..95b4d80461c1 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3226,7 +3226,7 @@ class PySignalsTest(SignalsTest): test_reentrant_write_text = None -def test_main(): +def load_tests(*args): tests = (CIOTest, PyIOTest, CBufferedReaderTest, PyBufferedReaderTest, CBufferedWriterTest, PyBufferedWriterTest, @@ -3259,7 +3259,8 @@ def test_main(): 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 index 0a9457939840..9a0c9ddb53e1 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -714,6 +714,9 @@ Tests - 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.