-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Pickle MagicMocks? #147
Comments
It's reasonable to think you can do it. I don't know exactly what the
Setting You can also turn on pickle 'tracing', to see what
Lastly, there are some decent diagnostic tools in |
no activity. reopen ticket if there's more to add |
I'm having this same issue. I tried changing the settings suggested by @mmckerns but have no luck. Here's a sample:
@MaximilianR Did you ever figure out a solution? |
@stdavis no The basic problem is that Mocks try and look like another class, and so when you need to know their class (i.e. when pickling them), you don't get the correct result. Would be interested if anyone has any creative approaches. For the moment we run a separate set of tests on concrete objects to ensure they pickle correctly |
I'm going to agree with @MaximilianR. If that's the case, then ultimately this is the same issue as #56. Basically, the derived class needs to have a way of informing the pickler what it's actual fully qualified name is instead of what is automatically generated -- using currying and many other factory methods break name-spacing for serializers in general. it's a long-standing issue. |
OK. Thanks for the info. |
Is this a realistic goal?
Or given that a MagicMock tries to look like something else, is this impossible?
The text was updated successfully, but these errors were encountered: