def METHOD_NAME(func) -> None:
    # make sure warnings are not elevated to errors in the assertion functions
    # e.g. by @pytest.mark.filterwarnings("error")
    # see https://github.com/pydata/xarray/pull/4760#issuecomment-774101639
    # define a custom Variable class that raises a warning in assert_*
    class WarningVariable(xr.Variable):
        @property  # type: ignore[misc]
        def dims(self):
            warnings.warn("warning in test")
            return super().dims
        def __array__(self):
            warnings.warn("warning in test")
            return super().__array__()
    a = WarningVariable("x", [1])
    b = WarningVariable("x", [2])
    with warnings.catch_warnings(record=True) as w:
        # elevate warnings to errors
        warnings.filterwarnings("error")
        with pytest.raises(AssertionError):
            getattr(xr.testing, func)(a, b)
        assert len(w) > 0
        # ensure warnings still raise outside of assert_*
        with pytest.raises(UserWarning):
            warnings.warn("test")
    # ensure warnings stay ignored in assert_*
    with warnings.catch_warnings(record=True) as w:
        # ignore warnings
        warnings.filterwarnings("ignore")
        with pytest.raises(AssertionError):
            getattr(xr.testing, func)(a, b)
        assert len(w) == 0