'If a predicate is passed for ``should_retry``, it used to determine
whether a retry should be attempted any time an exception is raised.'

def test_custom_should_retry(self):

    counter = iter(count())
    original = partial(self.always_failing, counter)
    wrapped = with_retry(original, should_retry=retry_if((lambda exception: (isinstance(exception, CustomException) and (exception.args[0] < 10)))), sleep=(lambda interval: None))
    self.expectThat(wrapped, raises(CustomException))
    self.expectThat(next(counter), Equals(11))
