Certain test runners (in my case, Django's RemoteTestRunner) 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 pickable is necessary to accumulate errors with the multiprocessing setup.
Certain test runners (in my case, Django's
RemoteTestRunner
) pickle the exceptions raised to accumulate them from multiple processes.For exceptions with
AttributeValidationNote
and/orIterableValidationNote
attached, because we have overridden__new__
on these classes, pickle cannot correctly unpickle them with the required arguments. For this use case, exceptions being pickable is necessary to accumulate errors with themultiprocessing
setup.This implements
__getnewargs__
to fix this problem.