def test_api2_runfunc():
    def noargs():
        pass

    with pytest.raises(SyntaxError):
        execute_python._runfunc_ok(noargs)

    def twoargs(a, b):
        pass

    with pytest.raises(SyntaxError):
        execute_python._runfunc_ok(twoargs)

    def two_with_default(a, b=2):
        pass

    # making sure this doesn't raise
    execute_python._runfunc_ok(two_with_default)

    def one_with_default(a=2):
        pass

    # shouldn't raise
    execute_python._runfunc_ok(one_with_default)

    def starargs(*args):
        pass

    # shouldn't raise
    execute_python._runfunc_ok(starargs)