def METHOD_NAME():
    ''' Tests assigning an invalid type to a PSyLoop object. '''
    _, invoke = get_invoke("single_invoke.f90", "gocean1.0", idx=0,
                           dist_mem=False)
    sched = invoke.schedule
    loop = sched.children[0].loop_body[0]
    assert isinstance(loop, PSyLoop)
    with pytest.raises(TypeError) as err:
        loop.loop_type = "not_a_valid_type"
    assert ("loop_type value (not_a_valid_type) is invalid. Must be one of "
            "['inner', 'outer']" in str(err.value))