MCPcopy Index your code
hub / github.com/python/cpython / test_pickling

Method test_pickling

Lib/test/datetimetester.py:2569–2576  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2567 self.assertRaises(TypeError, lambda: a + a)
2568
2569 def test_pickling(self):
2570 args = 6, 7, 23, 20, 59, 1, 64**2
2571 orig = self.theclass(*args)
2572 for pickler, unpickler, proto in pickle_choices:
2573 green = pickler.dumps(orig, proto)
2574 derived = unpickler.loads(green)
2575 self.assertEqual(orig, derived)
2576 self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
2577
2578 def test_more_pickling(self):
2579 a = self.theclass(2003, 2, 7, 16, 48, 37, 444116)

Callers

nothing calls this directly

Calls 5

dumpsMethod · 0.45
loadsMethod · 0.45
assertEqualMethod · 0.45
__reduce__Method · 0.45
__reduce_ex__Method · 0.45

Tested by

no test coverage detected