def METHOD_NAME():
    '''Test the check_datatype method works as expected.'''
    ScalarArgMetadata.check_datatype("GH_REAL")
    with pytest.raises(ValueError) as info:
        ScalarArgMetadata.check_datatype("invalid")
    assert ("The 'datatype descriptor' metadata should be a recognised value "
            "(one of ['gh_real', 'gh_integer', 'gh_logical']) but found "
            "'invalid'." in str(info.value))