summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-01-10 04:12:43 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-01-10 04:12:43 (GMT)
commit09a8e163daa5dacecfe8956409b0d26b5e691d30 (patch)
treed5e061d3a1f0a9b1ca0dda0ad0a4b0aaf96aada6
parente1b0d3e1230be2a378cf947488696752896bea29 (diff)
parentb21af554ee4d8cc8d6fdc81fb77b38e812f97a4d (diff)
downloadcpython-09a8e163daa5dacecfe8956409b0d26b5e691d30.zip
cpython-09a8e163daa5dacecfe8956409b0d26b5e691d30.tar.gz
cpython-09a8e163daa5dacecfe8956409b0d26b5e691d30.tar.bz2
#16898: merge with 3.3.
-rw-r--r--Lib/test/test_bufio.py11
-rw-r--r--Misc/NEWS3
2 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_bufio.py b/Lib/test/test_bufio.py
index 5ab6f5a..6338ad8 100644
--- a/Lib/test/test_bufio.py
+++ b/Lib/test/test_bufio.py
@@ -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()
diff --git a/Misc/NEWS b/Misc/NEWS
index 09d7b4b..4938a49 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -614,6 +614,9 @@ Tests
- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
+- 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.