Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pickle protocols coverage in test_slice #100931

Closed
sobolevn opened this issue Jan 11, 2023 · 1 comment
Closed

Improve pickle protocols coverage in test_slice #100931

sobolevn opened this issue Jan 11, 2023 · 1 comment
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Jan 11, 2023

While working on #100817 I've noticed that slice is only tested with 3 pickle protocols. See

def test_pickle(self):
s = slice(10, 20, 3)
for protocol in (0,1,2):
t = loads(dumps(s, protocol))
self.assertEqual(s, t)
self.assertEqual(s.indices(15), t.indices(15))
self.assertNotEqual(id(s), id(t))
I don't think we need to limited supported protocols. Let's test all protocols!

Linked PRs

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Jan 11, 2023
@sobolevn sobolevn self-assigned this Jan 11, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Jan 11, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Jan 12, 2023
…ythonGH-100932).

(cherry picked from commit 8795ad1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
sobolevn added a commit to sobolevn/cpython that referenced this issue Jan 12, 2023
…ythonGH-100932).

(cherry picked from commit 8795ad1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington pushed a commit that referenced this issue Jan 12, 2023
). (GH-100978)

(cherry picked from commit 8795ad1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Automerge-Triggered-By: GH:AlexWaygood
@AlexWaygood
Copy link
Member

Thanks!

miss-islington pushed a commit that referenced this issue Jan 12, 2023
). (GH-100979)

(cherry picked from commit 8795ad1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Automerge-Triggered-By: GH:AlexWaygood
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants