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

Method test_isocalendar_pickling

Lib/test/datetimetester.py:1528–1537  ·  view source on GitHub ↗

Test that the result of datetime.isocalendar() can be pickled. The result of a round trip should be a plain tuple.

(self)

Source from the content-addressed store, hash-verified

1526 self.assertEqual((t.year, t.week, t.weekday), exp_iso)
1527
1528 def test_isocalendar_pickling(self):
1529 """Test that the result of datetime.isocalendar() can be pickled.
1530
1531 The result of a round trip should be a plain tuple.
1532 """
1533 d = self.theclass(2019, 1, 1)
1534 p = pickle.dumps(d.isocalendar())
1535 res = pickle.loads(p)
1536 self.assertEqual(type(res), tuple)
1537 self.assertEqual(res, (2019, 1, 2))
1538
1539 def test_iso_long_years(self):
1540 # Calculate long ISO years and compare to table from

Callers

nothing calls this directly

Calls 4

isocalendarMethod · 0.80
dumpsMethod · 0.45
loadsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected