summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryio.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_memoryio.py')
-rw-r--r--Lib/test/test_memoryio.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index ab67cf3..24d282a 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -399,14 +399,19 @@ class BytesIOMixin:
# raises a BufferError.
self.assertRaises(BufferError, memio.write, b'x' * 100)
self.assertRaises(BufferError, memio.truncate)
+ self.assertRaises(BufferError, memio.close)
+ self.assertFalse(memio.closed)
# Mutating the buffer updates the BytesIO
buf[3:6] = b"abc"
self.assertEqual(bytes(buf), b"123abc7890")
self.assertEqual(memio.getvalue(), b"123abc7890")
- # After the buffer gets released, we can resize the BytesIO again
+ # After the buffer gets released, we can resize and close the BytesIO
+ # again
del buf
support.gc_collect()
memio.truncate()
+ memio.close()
+ self.assertRaises(ValueError, memio.getbuffer)
class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin,