

def test_retries_if_predicate_fails(self, sleep_mock):

    def always_fail():
        return False
    retry = retrying.Retry(max_attempts=5, wait_exponential=True, raise_error=False, predicate=always_fail)

    @retry
    def func():
        pass
    func()
    self.assertTrue((retry.attempt >= retry.max_attempts))
    self.assertEqual(sleep_mock.call_count, self.max_attempts)

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/utils/test_retrying.py RetryTestCase.test_retries_if_predicate_fails/VarMisuse@88/113 `retry`->`self`