def METHOD_NAME(fortran_reader):
    ''' Check that the transformation refuses to create a Kernel if the
    supplied PSyIR already contains one. '''
    trans = CreateNemoKernelTrans()
    psyir = fortran_reader.psyir_from_source(BASIC_KERN_CODE)
    loop = psyir.walk(Loop)[0]
    trans.apply(loop.loop_body)
    with pytest.raises(TransformationError) as err:
        trans.apply(loop.loop_body)
    assert ("A NEMO Kernel cannot contain a node of type: 'NemoKern'" in
            str(err.value))