MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_copy_pickle

Method test_copy_pickle

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

Source from the content-addressed store, hash-verified

819
820 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'Deque' object has no attribute 'x'
821 def test_copy_pickle(self):
822 for cls in Deque, DequeWithSlots:
823 for d in cls('abc'), cls('abcde', maxlen=4):
824 d.x = ['x']
825 d.z = ['z']
826
827 e = d.__copy__()
828 self.assertEqual(type(d), type(e))
829 self.assertEqual(list(d), list(e))
830
831 e = cls(d)
832 self.assertEqual(type(d), type(e))
833 self.assertEqual(list(d), list(e))
834
835 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
836 s = pickle.dumps(d, proto)
837 e = pickle.loads(s)
838 self.assertNotEqual(id(d), id(e))
839 self.assertEqual(type(d), type(e))
840 self.assertEqual(list(d), list(e))
841 self.assertEqual(e.x, d.x)
842 self.assertEqual(e.z, d.z)
843 self.assertNotHasAttr(e, 'y')
844
845 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'Deque' object has no attribute 'x'
846 def test_pickle_recursive(self):

Callers

nothing calls this directly

Calls 9

listClass · 0.85
idFunction · 0.85
assertNotEqualMethod · 0.80
clsClass · 0.50
__copy__Method · 0.45
assertEqualMethod · 0.45
dumpsMethod · 0.45
loadsMethod · 0.45
assertNotHasAttrMethod · 0.45

Tested by

no test coverage detected