summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email/test_pickleable.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_email/test_pickleable.py')
-rw-r--r--Lib/test/test_email/test_pickleable.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/test/test_email/test_pickleable.py b/Lib/test/test_email/test_pickleable.py
index daa8d25..16b4467 100644
--- a/Lib/test/test_email/test_pickleable.py
+++ b/Lib/test/test_email/test_pickleable.py
@@ -30,9 +30,10 @@ class TestPickleCopyHeader(TestEmailBase):
def header_as_pickle(self, name, value):
header = self.header_factory(name, value)
- p = pickle.dumps(header)
- h = pickle.loads(p)
- self.assertEqual(str(h), str(header))
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ p = pickle.dumps(header, proto)
+ h = pickle.loads(p)
+ self.assertEqual(str(h), str(header))
@parameterize
@@ -65,9 +66,10 @@ class TestPickleCopyMessage(TestEmailBase):
self.assertEqual(msg2.as_string(), msg.as_string())
def msg_as_pickle(self, msg):
- p = pickle.dumps(msg)
- msg2 = pickle.loads(p)
- self.assertEqual(msg2.as_string(), msg.as_string())
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ p = pickle.dumps(msg, proto)
+ msg2 = pickle.loads(p)
+ self.assertEqual(msg2.as_string(), msg.as_string())
if __name__ == '__main__':