def test_func_that_raises_too_many_time_raises(self): func = retry.wrap(get_dummy_func(50)) with raises(Exception) as e: func() assert str(e.value) == 'Test Error 5'
def test_retry_func_with_kwargs(self): func = retry.wrap(get_dummy_func()) assert func(foo='bar') == (CallCounter(5, 4), (), {'foo': 'bar'})
def test_retry_with_wait_function(self, mock_sleep): func = retry.wrap(get_dummy_func(), wait=lambda n: n) func() mock_sleep.assert_called_with(4)
def test_retry_func_with_args(self): func = retry.wrap(get_dummy_func()) assert func('arg') == (CallCounter(5, 4), ('arg', ), {})