Unitest mock issue

J

Joseph L. Casale

I am trying to patch a method of a class thats proving to be less than trivial.

The module I am writing a test for, ModuleA imports another ModuleB and
instantiates a class from this. Problem is, ModuleA incorporates multiprocessing
queues and I suspect I am missing the patch as the object in question is retrieved
from a queue and unpickled, at which point the method is invoked on that retrieved
object immediately.

Before the class I am patching is pickled, I don't invoke the method, but if I mock
the entire class, I can clearly see I am replacing it before pickling. So, given it is
this same module I am pickling/unpickling, what nuance have I missed in just
replacing the method of interest during unpickling?

Thanks for any guidance,
jlc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top