summaryrefslogtreecommitdiffstats
path: root/Lib/test/datetimetester.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:06:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:06:02 (GMT)
commit65ee4674e290ba893509f51f192dd1c9aa3a0422 (patch)
treec1e960162df4444ff18a2ad3aff11d713ef9ea12 /Lib/test/datetimetester.py
parent0e32ea1089059a15b04a40c43bfe671e38ae16e7 (diff)
parentbad1257c96943dcb39584a41e1a178542479df97 (diff)
downloadcpython-65ee4674e290ba893509f51f192dd1c9aa3a0422.zip
cpython-65ee4674e290ba893509f51f192dd1c9aa3a0422.tar.gz
cpython-65ee4674e290ba893509f51f192dd1c9aa3a0422.tar.bz2
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r--Lib/test/datetimetester.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index cf85bd8..564ff52 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -1704,11 +1704,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