summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_memoryio.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 49ca44f..9248098 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -654,6 +654,17 @@ class CBytesIOTest(PyBytesIOTest):
memio.close()
self.assertRaises(ValueError, memio.__setstate__, (b"closed", 0, None))
+ check_sizeof = support.check_sizeof
+
+ @support.cpython_only
+ def test_sizeof(self):
+ basesize = support.calcobjsize('P2PP2PP')
+ check = self.check_sizeof
+ self.assertEqual(object.__sizeof__(io.BytesIO()), basesize)
+ check(io.BytesIO(), basesize )
+ check(io.BytesIO(b'a'), basesize + 1 + 1 )
+ check(io.BytesIO(b'a' * 1000), basesize + 1000 + 1 )
+
class CStringIOTest(PyStringIOTest):
ioclass = io.StringIO