

def test_stops_if_retval_matches_predicate(self, sleep_mock):

    def func():
        return 0
    retry = retrying.Retry(max_attempts=5, predicate_retval_as_arg=True, predicate=(lambda rv: (rv == 0)))
    retry.run(func)
    self.assertEqual(retry.attempt, 1)
    self.assertFalse(sleep_mock.called)

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