MCPcopy Index your code
hub / github.com/python/cpython / test_sizeof

Method test_sizeof

Lib/test/test_deque.py:748–759  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

746
747 @support.cpython_only
748 def test_sizeof(self):
749 MAXFREEBLOCKS = 16
750 BLOCKLEN = 64
751 basesize = support.calcvobjsize('2P5n%dPP' % MAXFREEBLOCKS)
752 blocksize = struct.calcsize('P%dPP' % BLOCKLEN)
753 self.assertEqual(object.__sizeof__(deque()), basesize)
754 check = self.check_sizeof
755 check(deque(), basesize + blocksize)
756 check(deque('a'), basesize + blocksize)
757 check(deque('a' * (BLOCKLEN - 1)), basesize + blocksize)
758 check(deque('a' * BLOCKLEN), basesize + 2 * blocksize)
759 check(deque('a' * (42 * BLOCKLEN)), basesize + 43 * blocksize)
760
761class TestVariousIteratorArgs(unittest.TestCase):
762

Callers

nothing calls this directly

Calls 3

checkFunction · 0.70
assertEqualMethod · 0.45
__sizeof__Method · 0.45

Tested by

no test coverage detected