def patch(self, name):
    'Patch up <name> in self.setUp.'
    patcher = mock.patch(name)
    self.addCleanup(patcher.stop)
    return patcher.start()
Patch up <name> in self.setUp.
def patch(self, name):
    
    patcher = mock.patch(name)
    self.addCleanup(patcher.stop)
    return patcher.start()