I have a class like the below:
Class a:
def fn1(self):
p1=multiprocessing.Process(self.fn2, (arg1,)
p1.start()
p1.join()
def fn2(self, arg1):
…
I am trying to test it and I have mocked the self.fn2 call:
Test:
Class aTest(unittest.TestCase):
def testfn1(self):
a obj1
obj1.fn2 = MagicMock.mock()
obj1.fn1()
obj1.fn2.assert_called_once_with(arg1)
When I run the test, I notice that the function fn2 ( I don’t see debugs I have there) has been mocked. However, the call_count is 0. How to debug this further ?