diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-09-05 20:11:49 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-09-05 20:11:49 +0200 |
commit | 1d857453b7065dafdc34a72c1bbb2a993782b383 (patch) | |
tree | e1ba8cd8fd1fb6d2b811e96632e8efefa97a2d51 /Lib/test/test_memoryio.py | |
parent | 397e5c98bc27416fe8a407e39e4c5aa4baf94423 (diff) | |
download | cpython-1d857453b7065dafdc34a72c1bbb2a993782b383.tar.gz cpython-1d857453b7065dafdc34a72c1bbb2a993782b383.zip |
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.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py index 92480989aca..7c0c84f0d95 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 |