diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-15 12:03:42 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-15 12:03:42 (GMT) |
commit | bad1257c96943dcb39584a41e1a178542479df97 (patch) | |
tree | dbb4594291c7df3660da701eb062bec35446bcba /Lib/test/datetimetester.py | |
parent | 79b81738ef052e9406adb8e98f0d292928053c01 (diff) | |
download | cpython-bad1257c96943dcb39584a41e1a178542479df97.zip cpython-bad1257c96943dcb39584a41e1a178542479df97.tar.gz cpython-bad1257c96943dcb39584a41e1a178542479df97.tar.bz2 |
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r-- | Lib/test/datetimetester.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index cf496b4..f42b0f9 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1682,11 +1682,12 @@ class TestDateTime(TestDate): def test_more_pickling(self): a = self.theclass(2003, 2, 7, 16, 48, 37, 444116) - s = pickle.dumps(a) - b = pickle.loads(s) - self.assertEqual(b.year, 2003) - self.assertEqual(b.month, 2) - self.assertEqual(b.day, 7) + for proto in range(pickle.HIGHEST_PROTOCOL + 1): + s = pickle.dumps(a, proto) + b = pickle.loads(s) + self.assertEqual(b.year, 2003) + self.assertEqual(b.month, 2) + self.assertEqual(b.day, 7) def test_pickling_subclass_datetime(self): args = 6, 7, 23, 20, 59, 1, 64**2 |