python-minimock | simple library for Python mock objects | Mehr ...
minimock is a simple Python library for using mock objects. . Its mock objects will report any access made to the mock object's interfaces. By using the standard-library 'doctest' module, the programmer can easily make assertions about how mock objects are used by matching the reported access against expected behaviour. . Mock objects can return specified values, raise exceptions, etc. to simulate the mocked behaviour. Existing objects can optionally be replaced in-place in their namespace by a mock object, and restored safely after testing.