]> granicus.if.org Git - python/commitdiff
#16898: test_bufio now works with unittest test discovery. Patch by Zachary Ware.
authorEzio Melotti <ezio.melotti@gmail.com>
Thu, 10 Jan 2013 04:11:34 +0000 (06:11 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Thu, 10 Jan 2013 04:11:34 +0000 (06:11 +0200)
Lib/test/test_bufio.py
Misc/NEWS

index 5ab6f5a0da4d09d767031ddfae00bcb97b9f32cb..6338ad8e3c44bf3eb7a1bc48c2cd5f4022e28092 100644 (file)
@@ -11,7 +11,7 @@ import _pyio as pyio # Python implementation.
 lengths = list(range(1, 257)) + [512, 1000, 1024, 2048, 4096, 8192, 10000,
                                  16384, 32768, 65536, 1000000]
 
-class BufferSizeTest(unittest.TestCase):
+class BufferSizeTest:
     def try_one(self, s):
         # Write s + "\n" + s to file, then open it and ensure that successive
         # .readline()s deliver what we wrote.
@@ -62,15 +62,12 @@ class BufferSizeTest(unittest.TestCase):
         self.drive_one(bytes(1000))
 
 
-class CBufferSizeTest(BufferSizeTest):
+class CBufferSizeTest(BufferSizeTest, unittest.TestCase):
     open = io.open
 
-class PyBufferSizeTest(BufferSizeTest):
+class PyBufferSizeTest(BufferSizeTest, unittest.TestCase):
     open = staticmethod(pyio.open)
 
 
-def test_main():
-    support.run_unittest(CBufferSizeTest, PyBufferSizeTest)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
index 99cb90ddb084af19840681dbca94a9ebaeb6cc7d..f1e39aeb7e1dd7c825f2bdba6d6592f7283b36b2 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -408,6 +408,9 @@ Library
 Tests
 -----
 
+- Issue #16898: test_bufio now works with unittest test discovery.
+  Patch by Zachary Ware.
+
 - Issue #16888: test_array now works with unittest test discovery.
   Patch by Zachary Ware.