def METHOD_NAME():
    """PluginOverwriteWarning raised pointing to correct file."""
    with pytest.warns(PluginOverwriteWarning, match="DecayMegacomplex.+bar.+Dummy") as record:
        @megacomplex()
        class Dummy(DecayMegacomplex):
            type: str = "bar"
        assert len(record) == 1
        assert Path(record[0].filename) == Path(__file__)