'Install the mocks required.
Returns:
A context manager that when exits restores the mocks.'

def instrument(self):

    self.actions = []
    return utils.MultiStubber((requests, 'request', self.request), (time, 'sleep', self.sleep))
