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

Method test_pickler_super

Lib/test/test_pickle.py:310–323  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

308 check(PersUnpickler)
309
310 def test_pickler_super(self):
311 class PersPickler(self.pickler):
312 def persistent_id(subself, obj):
313 called.append(obj)
314 self.assertIsNone(super().persistent_id(obj))
315 return obj
316
317 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
318 f = io.BytesIO()
319 pickler = PersPickler(f, proto)
320 called = []
321 pickler.dump('abc')
322 self.assertEqual(called, ['abc'])
323 self.assertEqual(self.loads(f.getvalue()), 'abc')
324
325 def test_unpickler_super(self):
326 class PersUnpickler(self.unpickler):

Callers

nothing calls this directly

Calls 5

getvalueMethod · 0.95
PersPicklerClass · 0.70
dumpMethod · 0.45
assertEqualMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected