python-mock

Python Mock object with method called multiple times

Python Mock object with method called multiple times Question: I have a class that I’m testing which has as a dependency another class (an instance of which gets passed to the CUT’s init method). I want to mock out this class using the Python Mock library. What I have is something like: mockobj = Mock(spec=MyDependencyClass) …

Total answers: 4