Description
Python tests can replace collaborators with fake objects so real code can be exercised in controlled scenarios. This is useful for developers testing behavior without contacting databases, networks, files, or slow services.
It is a testing library. Mocks make tests easier to isolate, but they can also hide integration problems if used instead of testing important real interactions.