def METHOD_NAME(xp, actual, expected):
    ret_a, err_a = actual
    ret_e, err_e = expected
    if err_e is None:
        # Exception not raised
        if err_a is not None:
            raise err_a
        check(xp, ret_a, ret_e)
    else:
        if err_a is None:
            raise err_e