'Helper function that will result the desired number of response
failures.
:param rate_measurer: The ``RateMeasurer`` we are testing.
:param num_failures: The number of requests we want to fail.
:param num_samples: The number of samples to collect.'

def failed_requests(self, rate_measurer, num_failures, num_samples):

    result = Failure(RuntimeError('fail'))
    for _ in range((num_samples * num_failures)):
        rate_measurer.request_failed(result)
