]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Include the highest pickle protocol in a couple of tests. (GH-10735)
authorZackery Spytz <zspytz@gmail.com>
Tue, 27 Nov 2018 05:40:49 +0000 (22:40 -0700)
committerSerhiy Storchaka <storchaka@gmail.com>
Tue, 27 Nov 2018 05:40:49 +0000 (07:40 +0200)
test_reduce_ex() in test_array.py and
test_reversevaluesiterator_pickling() in test_dict.py weren't using
the highest pickle protocol.

Lib/test/test_array.py
Lib/test/test_dict.py

index e9218f3dd68cb230cf95165c11790ad1707bb67d..7f402f8644710303a865cd8c4ef8524de234dd93 100644 (file)
@@ -248,7 +248,7 @@ class BaseTest:
         a = array.array(self.typecode, self.example)
         for protocol in range(3):
             self.assertIs(a.__reduce_ex__(protocol)[0], array.array)
-        for protocol in range(3, pickle.HIGHEST_PROTOCOL):
+        for protocol in range(3, pickle.HIGHEST_PROTOCOL + 1):
             self.assertIs(a.__reduce_ex__(protocol)[0], array_reconstructor)
 
     def test_pickle(self):
index 71fffe398f3437befdcdf9dfb526f324eacd9233..03afd5b2a6c75e65698b102e2123e5c74797a37c 100644 (file)
@@ -1112,7 +1112,7 @@ class DictTest(unittest.TestCase):
             self.assertEqual(dict(it), data)
 
     def test_reversevaluesiterator_pickling(self):
-        for proto in range(pickle.HIGHEST_PROTOCOL):
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
             data = {1:"a", 2:"b", 3:"c"}
             # data.values() isn't picklable, only its iterator
             it = reversed(data.values())