'By default, ``retry_failure`` retries on any exception. However, if
it\'s given an iterable of expected exception types (exactly as one
might pass to ``Failure.check``), then it will only retry if one of
*those* exceptions is raised.'

def test_limited_exceptions(self):

    steps = [0.1, 0.2]
    result = object()
    type_error = Failure(TypeError('bad    type'))
    results = [Failure(ValueError('bad    value')), type_error, succeed(result)]
    def function():
        return results.pop(0)
    clock = Clock()
    d = retry_failure(clock, function, expected=[ValueError], steps=steps)
    self.assertNoResult(d)
    clock.advance(0.1)
    self.assertEqual(self.failureResultOf(d), type_error)
