10000 gh-131031: Fix separated running of `pickle` tests by donBarbos · Pull Request #133218 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131031: Fix separated running of pickle tests #133218

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix separated running of pickle tests
  • Loading branch information
donBarbos committed Apr 30, 2025
commit 2732a2221f2940be93db95104ad08bd8ab0114c0
16 changes: 8 additions & 8 deletions Lib/test/pickletester.py
Original file line number Diff line number Diff line change
Expand Up @@ -2289,10 +2289,10 @@ def test_nested_lookup_error(self):
with self.subTest(proto=proto):
with self.assertRaises(pickle.PicklingError) as cm:
self.dumps(obj, proto)
self.assertEqual(str(cm.exception),
f"Can't pickle {obj!r}: it's not found as __main__.AbstractPickleTests.spam")
self.assertEqual(str(cm.exception.__context__),
"module '__main__' has no attribute 'AbstractPickleTests'")
self.assertEqual(str(cm.exception),
f"Can't pickle {obj!r}: it's not found as __main__.AbstractPickleTests.spam")
self.assertEqual(str(cm.exception.__context__),
"module '__main__' has no attribute 'AbstractPickleTests'")

def test_wrong_object_lookup_error(self):
# Name is bound to different object
Expand All @@ -2312,10 +2312,10 @@ def test_wrong_object_lookup_error(self):
with self.subTest(proto=proto):
with self.assertRaises(pickle.PicklingError) as cm:
self.dumps(obj, proto)
self.assertEqual(str(cm.exception),
f"Can't pickle {obj!r}: it's not found as __main__.AbstractPickleTests")
self.assertEqual(str(cm.exception.__context__),
"module '__main__' has no attribute 'AbstractPickleTests'")
self.assertEqual(str(cm.exception),
f"Can't pickle {obj!r}: it's not found as __main__.AbstractPickleTests")
self.assertEqual(str(cm.exception.__context__),
"module '__main__' has no attribute 'AbstractPickleTests'")

def test_local_lookup_error(self):
# Test that whichmodule() errors out cleanly when looking up
Expand Down
Loading
0