diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2012-09-05 18:11:49 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-09-05 18:11:49 (GMT) |
| commit | c5eec0e387f3159288195ea8462345a9738d9a9d (patch) | |
| tree | 0412053fe88b069308c05f50b0c70e705e7ea5b6 /Lib/test/test_memoryio.py | |
| parent | 80f4553d56e88c002a0085afdc8a33b9d0bf0202 (diff) | |
| download | cpython-c5eec0e387f3159288195ea8462345a9738d9a9d.zip cpython-c5eec0e387f3159288195ea8462345a9738d9a9d.tar.gz cpython-c5eec0e387f3159288195ea8462345a9738d9a9d.tar.bz2 | |
Issue #15841: The readable(), writable() and seekable() methods of io.BytesIO
and io.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 007a092..c3d559d 100644 --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -328,9 +328,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) @@ -649,7 +649,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 |
