def METHOD_NAME(mat, labels, title):
    ax = plot_matrix(mat, labels=labels, title=title)
    nb_txt = 0 if title is None else len(title)
    assert len(ax._axes.title.get_text()) == nb_txt
    if title is not None:
        assert ax._axes.title.get_text() == title
    plt.close()