Skip to content

Commit d1cbc6f

Browse files
ZackerySpytzserhiy-storchaka
authored andcommitted
Include the highest pickle protocol in a couple of tests. (GH-10735)
test_reduce_ex() in test_array.py and test_reversevaluesiterator_pickling() in test_dict.py weren't using the highest pickle protocol.
1 parent da324d5 commit d1cbc6f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/test/test_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def test_reduce_ex(self):
248248
a = array.array(self.typecode, self.example)
249249
for protocol in range(3):
250250
self.assertIs(a.__reduce_ex__(protocol)[0], array.array)
251-
for protocol in range(3, pickle.HIGHEST_PROTOCOL):
251+
for protocol in range(3, pickle.HIGHEST_PROTOCOL + 1):
252252
self.assertIs(a.__reduce_ex__(protocol)[0], array_reconstructor)
253253

254254
def test_pickle(self):

Lib/test/test_dict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ def test_reverseitemiterator_pickling(self):
11121112
self.assertEqual(dict(it), data)
11131113

11141114
def test_reversevaluesiterator_pickling(self):
1115-
for proto in range(pickle.HIGHEST_PROTOCOL):
1115+
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
11161116
data = {1:"a", 2:"b", 3:"c"}
11171117
# data.values() isn't picklable, only its iterator
11181118
it = reversed(data.values())

0 commit comments

Comments
 (0)