#NEWLINE# def failed_requests( self , rate_measurer , num_failures , num_samples ) : #NEWLINE# #INDENT# '\n        Helper function that will result the desired number of response\n        failures.\n\n        :param rate_measurer: The ``RateMeasurer`` we are testing.\n        :param num_failures: The number of requests we want to fail.\n        :param num_samples: The number of samples to collect.\n        ' #NEWLINE# result = Failure ( RuntimeError ( 'fail' ) ) #NEWLINE# for i in range ( ( num_samples * num_failures ) ) : #NEWLINE# #INDENT# rate_measurer . request_failed ( result )