summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryio.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-09-05 18:11:49 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-09-05 18:11:49 (GMT)
commit1d857453b7065dafdc34a72c1bbb2a993782b383 (patch)
treee1ba8cd8fd1fb6d2b811e96632e8efefa97a2d51 /Lib/test/test_memoryio.py
parent397e5c98bc27416fe8a407e39e4c5aa4baf94423 (diff)
downloadcpython-1d857453b7065dafdc34a72c1bbb2a993782b383.zip
cpython-1d857453b7065dafdc34a72c1bbb2a993782b383.tar.gz
cpython-1d857453b7065dafdc34a72c1bbb2a993782b383.tar.bz2
Issue #15841: The readable(), writable() and seekable() methods of BytesIO
and StringIO objects now raise ValueError when the object has been closed. Patch by Alessandro Moura.
Diffstat (limited to 'Lib/test/test_memoryio.py')
-rw-r--r--Lib/test/test_memoryio.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 9248098..7c0c84f 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -318,9 +318,9 @@ class MemoryTestMixin:
self.assertEqual(memio.isatty(), False)
self.assertEqual(memio.closed, False)
memio.close()
- self.assertEqual(memio.writable(), True)
- self.assertEqual(memio.readable(), True)
- self.assertEqual(memio.seekable(), True)
+ self.assertRaises(ValueError, memio.writable)
+ self.assertRaises(ValueError, memio.readable)
+ self.assertRaises(ValueError, memio.seekable)
self.assertRaises(ValueError, memio.isatty)
self.assertEqual(memio.closed, True)
@@ -665,7 +665,6 @@ class CBytesIOTest(PyBytesIOTest):
check(io.BytesIO(b'a'), basesize + 1 + 1 )
check(io.BytesIO(b'a' * 1000), basesize + 1000 + 1 )
-
class CStringIOTest(PyStringIOTest):
ioclass = io.StringIO
UnsupportedOperation = io.UnsupportedOperation