

def test_does_not_retry_if_predicate_succeeds(self, sleep_mock):

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

    @retry
    def func():
        pass
    func()
    self.assertEqual(sleep_mock.attempt, 1)
    self.assertFalse(sleep_mock.called)

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/utils/test_retrying.py RetryTestCase.test_does_not_retry_if_predicate_succeeds/VarMisuse@69/93 `retry`->`sleep_mock`