diff options
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-x | Lib/test/test_array.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index eb6d77f..544c2ce 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -1015,6 +1015,19 @@ class BaseTest(unittest.TestCase): a = array.array('H', b"1234") self.assertEqual(len(a) * a.itemsize, 4) + @support.cpython_only + def test_sizeof_with_buffer(self): + a = array.array(self.typecode, self.example) + basesize = support.calcvobjsize('Pn2Pi') + buffer_size = a.buffer_info()[1] * a.itemsize + support.check_sizeof(self, a, basesize + buffer_size) + + @support.cpython_only + def test_sizeof_without_buffer(self): + a = array.array(self.typecode) + basesize = support.calcvobjsize('Pn2Pi') + support.check_sizeof(self, a, basesize) + class StringTest(BaseTest): |