def METHOD_NAME(custom_filetypes, caplog, tmp_path):
    def lexer_name(path):
        return filetypes.guess_filetype_from_path(path)["pygments_lexer"]
    assert lexer_name(tmp_path / "foo" / "bar.html") == "pygments.lexers.HtmlLexer"
    assert lexer_name(tmp_path / "lol-mako-templates" / "bar.html") == "pygments.lexers.HtmlLexer"
    with caplog.at_level(logging.WARNING):
        assert (
            lexer_name(tmp_path / "mako-templates" / "bar.html") == "pygments.lexers.MakoHtmlLexer"
        )
    assert len(caplog.records) == 1
    assert "2 file types match" in caplog.records[0].message
    assert str(tmp_path) in caplog.records[0].message
    assert "HTML, Mako template" in caplog.records[0].message