mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-100931: Test all pickle
protocols in test_slice
(#100932)
This commit is contained in:
parent
8dd2766d99
commit
8795ad1bd0
2 changed files with 4 additions and 2 deletions
|
@ -235,8 +235,10 @@ class SliceTest(unittest.TestCase):
|
|||
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