From e52d37bc9f700d90d27b676d9a9ff8e4cc3c4361 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 11 Jan 2023 12:43:45 +0300 Subject: [PATCH] [3.11] gh-100931: Test all `pickle` protocols in `test_slice` (GH-100932). (cherry picked from commit 8795ad1bd0d6ee031543fcaf5a86a60b37950714) Co-authored-by: Nikita Sobolev --- Lib/test/test_slice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_slice.py b/Lib/test/test_slice.py index 4ae4142c60c8a8..c4bc8c82023d74 100644 --- a/Lib/test/test_slice.py +++ b/Lib/test/test_slice.py @@ -235,8 +235,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)) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy