summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-02-24 02:51:05 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-02-24 02:51:05 (GMT)
commit67bfe8075822b226793ce672751329dd658af9af (patch)
tree49abcce706c2ce732e04afb9805ea550b4692f2e /Lib/test/test_io.py
parent0362b54fd9e8158c4b62386f1bd654daf1095ed4 (diff)
downloadcpython-67bfe8075822b226793ce672751329dd658af9af.zip
cpython-67bfe8075822b226793ce672751329dd658af9af.tar.gz
cpython-67bfe8075822b226793ce672751329dd658af9af.tar.bz2
#17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error. Patch by Manuel Jacob.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index a7e596a..8ef314e 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -1039,6 +1039,12 @@ class CBufferedReaderTest(BufferedReaderTest, SizeofTest):
support.gc_collect()
self.assertTrue(wr() is None, wr)
+ def test_args_error(self):
+ # Issue #17275
+ with self.assertRaisesRegex(TypeError, "BufferedReader"):
+ self.tp(io.BytesIO(), 1024, 1024, 1024)
+
+
class PyBufferedReaderTest(BufferedReaderTest):
tp = pyio.BufferedReader
@@ -1321,6 +1327,11 @@ class CBufferedWriterTest(BufferedWriterTest, SizeofTest):
with self.open(support.TESTFN, "rb") as f:
self.assertEqual(f.read(), b"123xxx")
+ def test_args_error(self):
+ # Issue #17275
+ with self.assertRaisesRegex(TypeError, "BufferedWriter"):
+ self.tp(io.BytesIO(), 1024, 1024, 1024)
+
class PyBufferedWriterTest(BufferedWriterTest):
tp = pyio.BufferedWriter
@@ -1674,6 +1685,7 @@ class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest):
# You can't construct a BufferedRandom over a non-seekable stream.
test_unseekable = None
+
class CBufferedRandomTest(BufferedRandomTest, SizeofTest):
tp = io.BufferedRandom
@@ -1691,6 +1703,12 @@ class CBufferedRandomTest(BufferedRandomTest, SizeofTest):
CBufferedReaderTest.test_garbage_collection(self)
CBufferedWriterTest.test_garbage_collection(self)
+ def test_args_error(self):
+ # Issue #17275
+ with self.assertRaisesRegex(TypeError, "BufferedRandom"):
+ self.tp(io.BytesIO(), 1024, 1024, 1024)
+
+
class PyBufferedRandomTest(BufferedRandomTest):
tp = pyio.BufferedRandom