

def test_retries_on_invalid_return_value(self, sleep_mock):
    bad_value = 10
    retry = retrying.Retry(max_attempts=5, retry_on_return_value=True, return_value=bad_value, raise_error=False)

    @retry
    def func():
        return bad_value
    func()
    self.assertEqual(retry.attempt, retry.max_attempts)
    self.assertEqual(sleep_mock.call_count, retry.max_attempts)

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/utils/test_retrying.py RetryTestCase.test_retries_on_invalid_return_value/original