mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
[3.11] gh-100931: Test all pickle protocols in test_slice (GH-100932). (GH-100979)
(cherry picked from commit 8795ad1bd0)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Automerge-Triggered-By: GH:AlexWaygood
This commit is contained in:
parent
db2643737d
commit
cb6ff54b01
1 changed files with 3 additions and 1 deletions
|
|
@ -236,8 +236,10 @@ def __setitem__(self, i, k):
|
|||
self.assertEqual(tmp, [(slice(1, 2), 42)])
|
||||
|
||||
def test_pickle(self):
|
||||
import pickle
|
||||
|
||||
s = slice(10, 20, 3)
|
||||
for protocol in (0,1,2):
|
||||
for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
t = loads(dumps(s, protocol))
|
||||
self.assertEqual(s, t)
|
||||
self.assertEqual(s.indices(15), t.indices(15))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue