Commits

Ezio Melotti committed 09d4b69

#16898: test_bufio now works with unittest test discovery. Patch by Zachary Ware.

Comments (0)

Files changed (2)

Lib/test/test_bufio.py

 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.
         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()
 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.