]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#17479: test_io now works with unittest test discovery. Patch by Zachary Ware.
authorEzio Melotti <ezio.melotti@gmail.com>
Sat, 23 Mar 2013 14:30:16 +0000 (16:30 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Sat, 23 Mar 2013 14:30:16 +0000 (16:30 +0200)
Lib/test/test_io.py
Misc/NEWS

index 64c66d8867334e2984ad122d152c6371b53143a2..95b4d80461c1e3afc4bb9218a47ee0da2fa4a50a 100644 (file)
@@ -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()
index 0a9457939840653020cf3091d6e1ab4d203b133e..9a0c9ddb53e15bcdb443b110296dc0ceea3eab84 100644 (file)
--- 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.