(self)
| 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): |
nothing calls this directly
no test coverage detected