Closed programmerPhysicist closed 8 months ago
I think you can do this either so
pkl_file = mock()
when2(open, ...).thenCallOriginalImplementation()
when2(open, 'oneWay_matchDict.pkl', 'rb').thenReturn(pkl_file)
or so
pkl_file = mock()
spy2(open)
when2(open, 'oneWay_matchDict.pkl', 'rb').thenReturn(pkl_file)
🤞
When I try to mock open() with mockito in python, I get the following error:
The line to be mocked looks like this:
While the mock looks like this:
How do I ignore other invocations of open?