'Returns a started `mock.patch` object for the supplied target.
The caller may then call the returned patcher to create a mock object.
The caller does not need to call stop() on the returned
patcher object, as this method automatically adds a cleanup
to the test class to stop the patcher.
:param target: String module.class or module.object expression to patch
:param **kwargs: Passed as-is to `mock.patch`. See mock documentation
for details.'

def patch(self, target, **kwargs):

    p = mock.patch(target, **kwargs)
    m = p.start()
    self.addCleanup(p.stop)
    return m
