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

Method test_pickling

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

Source from the content-addressed store, hash-verified

2528 self.assertRaises(TypeError, lambda: a + a)
2529
2530 def test_pickling(self):
2531 args = 6, 7, 23, 20, 59, 1, 64**2
2532 orig = self.theclass(*args)
2533 for pickler, unpickler, proto in pickle_choices:
2534 green = pickler.dumps(orig, proto)
2535 derived = unpickler.loads(green)
2536 self.assertEqual(orig, derived)
2537 self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
2538
2539 def test_more_pickling(self):
2540 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