Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b21af55

Browse files
committed
#16898: test_bufio now works with unittest test discovery. Patch by Zachary Ware.
1 parent 1d3e96d commit b21af55

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Lib/test/test_bufio.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
lengths = list(range(1, 257)) + [512, 1000, 1024, 2048, 4096, 8192, 10000,
1212
16384, 32768, 65536, 1000000]
1313

14-
class BufferSizeTest(unittest.TestCase):
14+
class BufferSizeTest:
1515
def try_one(self, s):
1616
# Write s + "\n" + s to file, then open it and ensure that successive
1717
# .readline()s deliver what we wrote.
@@ -62,15 +62,12 @@ def test_nullpat(self):
6262
self.drive_one(bytes(1000))
6363

6464

65-
class CBufferSizeTest(BufferSizeTest):
65+
class CBufferSizeTest(BufferSizeTest, unittest.TestCase):
6666
open = io.open
6767

68-
class PyBufferSizeTest(BufferSizeTest):
68+
class PyBufferSizeTest(BufferSizeTest, unittest.TestCase):
6969
open = staticmethod(pyio.open)
7070

7171

72-
def test_main():
73-
support.run_unittest(CBufferSizeTest, PyBufferSizeTest)
74-
7572
if __name__ == "__main__":
76-
test_main()
73+
unittest.main()

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ Library
408408
Tests
409409
-----
410410

411+
- Issue #16898: test_bufio now works with unittest test discovery.
412+
Patch by Zachary Ware.
413+
411414
- Issue #16888: test_array now works with unittest test discovery.
412415
Patch by Zachary Ware.
413416

0 commit comments

Comments
 (0)