Skip to content

tests test_pickle failed due to error message mismatch #131031

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

Open
donBarbos opened this issue Mar 10, 2025 · 0 comments
Open

tests test_pickle failed due to error message mismatch #131031

donBarbos opened this issue Mar 10, 2025 · 0 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@donBarbos
Copy link
Contributor

donBarbos commented Mar 10, 2025

I ran separate tests for the pickle module on main branch:

./python ./Lib/test/test_pickle.py

I got 24 failures
Judging by the output, the problem is in the mismatch of error messages:

test_nested_lookup_error (__main__.CPicklingErrorTests.test_nested_lookup_error) ...
  test_nested_lookup_error (__main__.CPicklingErrorTests.test_nested_lookup_error) (proto=0) ... FAIL
  test_nested_lookup_error (__main__.CPicklingErrorTests.test_nested_lookup_error) (proto=1) ... FAIL
  test_nested_lookup_error (__main__.CPicklingErrorTests.test_nested_lookup_error) (proto=2) ... FAIL
  test_nested_lookup_error (__main__.CPicklingErrorTests.test_nested_lookup_error) (proto=3) ... FAIL
  test_nested_lookup_error (__main__.CPicklingErrorTests.test_nested_lookup_error) (proto=4) ... FAIL
  test_nested_lookup_error (__main__.CPicklingErrorTests.test_nested_lookup_error) (proto=5) ... FAIL
...
test_wrong_object_lookup_error (__main__.CPicklingErrorTests.test_wrong_object_lookup_error) ...
  test_wrong_object_lookup_error (__main__.CPicklingErrorTests.test_wrong_object_lookup_error) (proto=0) ... FAIL
  test_wrong_object_lookup_error (__main__.CPicklingErrorTests.test_wrong_object_lookup_error) (proto=1) ... FAIL
  test_wrong_object_lookup_error (__main__.CPicklingErrorTests.test_wrong_object_lookup_error) (proto=2) ... FAIL
  test_wrong_object_lookup_error (__main__.CPicklingErrorTests.test_wrong_object_lookup_error) (proto=3) ... FAIL
  test_wrong_object_lookup_error (__main__.CPicklingErrorTests.test_wrong_object_lookup_error) (proto=4) ... FAIL
  test_wrong_object_lookup_error (__main__.CPicklingErrorTests.test_wrong_object_lookup_error) (proto=5) ... FAIL
...
test_nested_lookup_error (__main__.PyPicklingErrorTests.test_nested_lookup_error) ...
  test_nested_lookup_error (__main__.PyPicklingErrorTests.test_nested_lookup_error) (proto=0) ... FAIL
  test_nested_lookup_error (__main__.PyPicklingErrorTests.test_nested_lookup_error) (proto=1) ... FAIL
  test_nested_lookup_error (__main__.PyPicklingErrorTests.test_nested_lookup_error) (proto=2) ... FAIL
  test_nested_lookup_error (__main__.PyPicklingErrorTests.test_nested_lookup_error) (proto=3) ... FAIL
  test_nested_lookup_error (__main__.PyPicklingErrorTests.test_nested_lookup_error) (proto=4) ... FAIL
  test_nested_lookup_error (__main__.PyPicklingErrorTests.test_nested_lookup_error) (proto=5) ... FAIL
...
test_wrong_object_lookup_error (__main__.PyPicklingErrorTests.test_wrong_object_lookup_error) ...
  test_wrong_object_lookup_error (__main__.PyPicklingErrorTests.test_wrong_object_lookup_error) (proto=0) ... FAIL
  test_wrong_object_lookup_error (__main__.PyPicklingErrorTests.test_wrong_object_lookup_error) (proto=1) ... FAIL
  test_wrong_object_lookup_error (__main__.PyPicklingErrorTests.test_wrong_object_lookup_error) (proto=2) ... FAIL
  test_wrong_object_lookup_error (__main__.PyPicklingErrorTests.test_wrong_object_lookup_error) (proto=3) ... FAIL
  test_wrong_object_lookup_error (__main__.PyPicklingErrorTests.test_wrong_object_lookup_error) (proto=4) ... FAIL
  test_wrong_object_lookup_error (__main__.PyPicklingErrorTests.test_wrong_object_lookup_error) (proto=5) ... FAIL

Examples of mismatches:

AssertionError: "type object 'AbstractPickleTests' has no attribute 'spam'" != "module '__main__' has no attribute 'AbstractPickleTests'"
- type object 'AbstractPickleTests' has no attribute 'spam'
+ module '__main__' has no attribute 'AbstractPickleTests'
...
AssertionError: "Can'[53 chars]4b0>: it's not the same object as __main__.AbstractPickleTests" != "Can'[53 chars]4b0>: it's not found as __main__.AbstractPickleTests"
- Can't pickle <test.pickletester.REX object at 0x79fcb255a4b0>: it's not the same object as __main__.AbstractPickleTests
?                                                                         ^^^^^^^^^ ^^^^^
+ Can't pickle <test.pickletester.REX object at 0x79fcb255a4b0>: it's not found as __main__.AbstractPickleTests
?

I'm going to send PR after we decide what the messages should look like

Linked PRs

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
Status: No status
Development

No branches or pull requests

3 participants