(self)
| 3674 | self.assert_is_copy(x, y) |
| 3675 | |
| 3676 | def test_complex_newobj_ex(self): |
| 3677 | if self.py_version < (3, 4): |
| 3678 | self.skipTest('not supported in Python < 3.4') |
| 3679 | x = ComplexNewObjEx.__new__(ComplexNewObjEx, 0xface) # avoid __init__ |
| 3680 | x.abc = 666 |
| 3681 | for proto in protocols: |
| 3682 | with self.subTest(proto=proto): |
| 3683 | if self.py_version < (3, 6) and proto < 4: |
| 3684 | self.skipTest('requires protocol 4 in Python < 3.6') |
| 3685 | s = self.dumps(x, proto) |
| 3686 | if proto < 1: |
| 3687 | if self.py_version >= (3, 7): |
| 3688 | self.assertIn(b'\nI64206', s) # INT |
| 3689 | else: # for test_xpickle |
| 3690 | self.assertIn(b'64206', s) # INT or LONG |
| 3691 | elif proto < 2: |
| 3692 | self.assertIn(b'M\xce\xfa', s) # BININT2 |
| 3693 | elif proto < 4: |
| 3694 | self.assertIn(b'X\x04\x00\x00\x00FACE', s) # BINUNICODE |
| 3695 | else: |
| 3696 | self.assertIn(b'\x8c\x04FACE', s) # SHORT_BINUNICODE |
| 3697 | self.assertFalse(opcode_in_pickle(pickle.NEWOBJ, s)) |
| 3698 | self.assertEqual(opcode_in_pickle(pickle.NEWOBJ_EX, s), |
| 3699 | 4 <= proto) |
| 3700 | y = self.loads(s) # will raise TypeError if __init__ called |
| 3701 | self.assert_is_copy(x, y) |
| 3702 | |
| 3703 | def test_newobj_list_slots(self): |
| 3704 | x = SlotList([1, 2, 3]) |
nothing calls this directly
no test coverage detected