(self)
| 3598 | self.assertTrue(num_setitems >= 2) |
| 3599 | |
| 3600 | def test_set_chunking(self): |
| 3601 | n = 10 # too small to chunk |
| 3602 | x = set(range(n)) |
| 3603 | for proto in protocols: |
| 3604 | s = self.dumps(x, proto) |
| 3605 | y = self.loads(s) |
| 3606 | self.assert_is_copy(x, y) |
| 3607 | num_additems = count_opcode(pickle.ADDITEMS, s) |
| 3608 | if proto < 4: |
| 3609 | self.assertEqual(num_additems, 0) |
| 3610 | else: |
| 3611 | self.assertEqual(num_additems, 1) |
| 3612 | |
| 3613 | n = 2500 # expect at least two chunks when proto >= 4 |
| 3614 | x = set(range(n)) |
| 3615 | for proto in protocols: |
| 3616 | s = self.dumps(x, proto) |
| 3617 | y = self.loads(s) |
| 3618 | self.assert_is_copy(x, y) |
| 3619 | num_additems = count_opcode(pickle.ADDITEMS, s) |
| 3620 | if proto < 4: |
| 3621 | self.assertEqual(num_additems, 0) |
| 3622 | else: |
| 3623 | self.assertGreaterEqual(num_additems, 2) |
| 3624 | |
| 3625 | def test_simple_newobj(self): |
| 3626 | x = SimpleNewObj.__new__(SimpleNewObj, 0xface) # avoid __init__ |
nothing calls this directly
no test coverage detected