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

Make validation notes picklable. #408

Merged
merged 1 commit into from
Aug 5, 2023
Merged

Commits on Aug 5, 2023

  1. Make validation notes picklable.

    Certain test runners pickle the exceptions raised to accumulate them from
    multiple processes.
    
    For exceptions with `AttributeValidationNote` and/or `IterableValidationNote`
    attached, because we have overridden `__new__` on these classes, pickle cannot
    correctly unpickle them with the required arguments. For this use case,
    exceptions being picklable is necessary to accumulate errors with the
    `multiprocessing` setup.
    
    This implements `__getnewargs__` to fix this problem.
    
    Certain test runners that pickle the exceptions raised to accumulate
    them from multiple processes. For exceptions with `AttributeValidationNote`
    and/or `IterableValidationNote`, because we have overriden __new__ on
    these classes, pickle is not able to correctly unpickle them with the required
    arguments. This implements __getnewargs__ to fix this problem.
    
    Signed-off-by: Zixuan James Li <p359101898@gmail.com>
    PIG208 committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    5ce946d View commit details
    Browse the repository at this point in the history