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

Skip to content

Commit daa42c7

Browse files
committed
#17479: test_io now works with unittest test discovery. Patch by Zachary Ware.
1 parent 325dc88 commit daa42c7

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Lib/test/test_io.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3226,7 +3226,7 @@ class PySignalsTest(SignalsTest):
32263226
test_reentrant_write_text = None
32273227

32283228

3229-
def test_main():
3229+
def load_tests(*args):
32303230
tests = (CIOTest, PyIOTest,
32313231
CBufferedReaderTest, PyBufferedReaderTest,
32323232
CBufferedWriterTest, PyBufferedWriterTest,
@@ -3259,7 +3259,8 @@ def test_main():
32593259
for name, obj in py_io_ns.items():
32603260
setattr(test, name, obj)
32613261

3262-
support.run_unittest(*tests)
3262+
suite = unittest.TestSuite([unittest.makeSuite(test) for test in tests])
3263+
return suite
32633264

32643265
if __name__ == "__main__":
3265-
test_main()
3266+
unittest.main()

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,9 @@ Tests
714714

715715
- Issue #15539: Added regression tests for Tools/scripts/pindent.py.
716716

717+
- Issue #17479: test_io now works with unittest test discovery.
718+
Patch by Zachary Ware.
719+
717720
- Issue #17066: test_robotparser now works with unittest test discovery.
718721
Patch by Zachary Ware.
719722

0 commit comments

Comments
 (0)