Understanding the Python Mock Object Library – Real Python
To do so, install mock from PyPI: $ pip install mock unittest.mock provides a class called Mock which you will use to imitate real objects in your codebase. Mock offers incredible flexibility and insightful data. This, along with its subclasses, will meet most Python mocking needs that you will face in your tests.
DA: 58 PA: 97 MOZ Rank: 28