

def test_raises_last_error_if_all_attempts_failed(self, sleep_mock):
    retry = retrying.Retry(max_attempts=5, wait_exponential=False, reraise_original_exception=True)

    @retry
    def func():
        raise ValueError()
    self.assertRaises(ValueError, func)
    self.assertEqual(retry.attempt, retry.max_attempts)
    sleep_mock.assertEqual(sleep_mock.call_count, retry.max_attempts)

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/utils/test_retrying.py RetryTestCase.test_raises_last_error_if_all_attempts_failed/VarMisuse@70/95 `self`->`sleep_mock`