def METHOD_NAME(self, mocker, opt, opt_name, tol):
    """Test that the keywords get passed and alter the function"""
    class func_wrapper:
        @staticmethod
        def func(x, c=1.0):
            return (x - c) ** 2
    x = np.array(1.0, requires_grad=True)
    wrapper = func_wrapper()
    spy = mocker.spy(wrapper, "func")
    _ = opt.step(wrapper.func, x, c=2.0)
    self.reset(opt)
    args2, kwargs2 = spy.call_args_list[-1]
    _, cost_three = opt.step_and_cost(wrapper.func, x, c=3.0)
    self.reset(opt)
    args3, kwargs3 = spy.call_args_list[-1]
    assert args2 == (x,)
    assert args3 == (x,)
    assert kwargs2 == {"c": 2.0}
    assert kwargs3 == {"c": 3.0}
    assert np.allclose(cost_three, wrapper.func(x, c=3.0), atol=tol)