Helpers for monkey-patching Python code.
Class MonkeyPatcher A set of monkey-patches that can be applied and removed all together.
Function patch Set 'obj.attribute' to 'value' and return a callable to restore 'obj'.
def patch(obj, attribute, value):

Set 'obj.attribute' to 'value' and return a callable to restore 'obj'.

If 'attribute' is not set on 'obj' already, then the returned callable will delete the attribute when called.

ParametersobjAn object to monkey-patch.
attributeThe name of the attribute to patch.
valueThe value to set 'obj.attribute' to.
ReturnsA nullary callable that, when run, will restore 'obj' to its original state.
API Documentation for testtools, generated by pydoctor at 2015-07-01 16:11:28.