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

Method test_pickle_recursive

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

Source from the content-addressed store, hash-verified

844
845 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'Deque' object has no attribute 'x'
846 def test_pickle_recursive(self):
847 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
848 for d in Deque('abc'), Deque('abc', 3):
849 d.append(d)
850
851 e = pickle.loads(pickle.dumps(d, proto))
852 self.assertNotEqual(id(e), id(d))
853 self.assertEqual(type(e), type(d))
854 self.assertEqual(e.maxlen, d.maxlen)
855 dd = d.pop()
856 ee = e.pop()
857 self.assertEqual(id(ee), id(e))
858 self.assertEqual(e, d)
859
860 d.x = d
861 e = pickle.loads(pickle.dumps(d, proto))
862 self.assertEqual(id(e.x), id(e))
863
864 for d in DequeWithBadIter('abc'), DequeWithBadIter('abc', 2):
865 self.assertRaises(TypeError, pickle.dumps, d, proto)
866
867 def test_weakref(self):
868 d = deque('gallahad')

Callers

nothing calls this directly

Calls 10

DequeClass · 0.85
idFunction · 0.85
DequeWithBadIterClass · 0.85
assertNotEqualMethod · 0.80
appendMethod · 0.45
loadsMethod · 0.45
dumpsMethod · 0.45
assertEqualMethod · 0.45
popMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected