def test_retry_many_errors():
    calls = []

    def failing(n=1):
        if len(calls) < n:
            calls.append(1)
            raise MyError
        return 1

    assert retry(2, (MyError, RuntimeError))(failing)() == 1
    calls = []
    assert retry(2, [MyError, RuntimeError])(failing)() == 1
dataset/ETHPy150Open Suor/funcy/tests/test_flow.py/test_retry_many_errors/original