def METHOD_NAME(self):
    dec = self.dep_maker(warn_class=UserWarning)
    func = dec('foo')(func_no_doc)
    with pytest.warns(UserWarning) as w:
        # warnings.simplefilter('always')
        assert func() is None
        assert len(w) == 1
    dec = self.dep_maker(error_class=CustomError)
    func = dec('foo')(func_no_doc)
    with pytest.deprecated_call():
        assert func() is None
    func = dec('foo', until='1.8')(func_no_doc)
    with pytest.raises(CustomError):
        func()