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

Method test_framing_many_objects

Lib/test/pickletester.py:3907–3922  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3905 @support.skip_if_pgo_task
3906 @support.requires_resource('cpu')
3907 def test_framing_many_objects(self):
3908 if self.py_version < (3, 4):
3909 self.skipTest('not supported in Python < 3.4')
3910 obj = list(range(10**5))
3911 for proto in range(4, pickle.HIGHEST_PROTOCOL + 1):
3912 with self.subTest(proto=proto):
3913 pickled = self.dumps(obj, proto)
3914 unpickled = self.loads(pickled)
3915 self.assertEqual(obj, unpickled)
3916 bytes_per_frame = (len(pickled) /
3917 count_opcode(pickle.FRAME, pickled))
3918 self.assertGreater(bytes_per_frame,
3919 self.FRAME_SIZE_TARGET / 2)
3920 self.assertLessEqual(bytes_per_frame,
3921 self.FRAME_SIZE_TARGET * 1)
3922 self.check_frame_opcodes(pickled)
3923
3924 def test_framing_large_objects(self):
3925 if self.py_version < (3, 4):

Callers

nothing calls this directly

Calls 10

check_frame_opcodesMethod · 0.95
listClass · 0.85
count_opcodeFunction · 0.85
skipTestMethod · 0.80
assertGreaterMethod · 0.80
assertLessEqualMethod · 0.80
subTestMethod · 0.45
dumpsMethod · 0.45
loadsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected