Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-131031: Fix separated running ofpickle 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
pickle testspickle testsdonBarbos commentedApr 30, 2025
cc@tomasr8 (sorry for choosing you but current pickle expert is inactive) |
tomasr8 commentedApr 30, 2025
Are you sure the assertions are being executed? Since |
donBarbos commentedMay 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
tomasr8 commentedMay 3, 2025
This looks ok, but I'm not expert in his area :/@serhiy-storchaka could you have a look? |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
serhiy-storchaka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good PR, but using a global class which is not imported intest_pickle.py instead ofAbstractPickleTests would fix the tests too. See#133356.
Faking the__main__ module looks heavyweight, we don't know what side effects can it have. We would use this approach if there was no other way.
| real_main=sys.modules.get("__main__") | ||
| fake_main=types.ModuleType("__main__") | ||
| sys.modules["__main__"]=fake_main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You can usesupport.swap_item(). It is already used in other tests to fake a module.
Uh oh!
There was an error while loading.Please reload this page.
I found that tests stopped running successfully directly afterthis commit (PR#122373)
test_pickletests failing when invoked directly #131031