class_docstr: Test for the dispatching logic of the parameter shift method
docstr: Test that if the force_order2 keyword argument is provided,
  the second order parameter shift rule is forced
docstr_tok: ["Test","that","if","the","force_order2","keyword","argument","is","provided",",","the","second","order","parameter","shift","rule","is","forced"]
code: def test_force_order2(self, mocker):
      """Test that if the force_order2 keyword argument is provided,
      the second order parameter shift rule is forced"""
      spy = mocker.spy(
          qml.gradients.parameter_shift_cv, "second_order_param_shift"
      )
  
      dev = qml.device("default.gaussian", wires=1)
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.Displacement(1.0, 0.0, wires=[0])
          qml.Rotation(2.0, wires=[0])
          qml.expval(qml.QuadX(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tape.trainable_params = {0, 1, 2}
  
      qml.gradients.param_shift_cv(tape, dev, force_order2=False)
      spy.assert_not_called()
  
      qml.gradients.param_shift_cv(tape, dev, force_order2=True)
      spy.assert_called()
  
imports: import unittest.mock
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.gradients import param_shift_cv
  from pennylane.gradients.gradient_transform import choose_trainable_params
  from pennylane.gradients.parameter_shift_cv import _grad_method_cv, _find_gradient_methods_cv, _transform_observable
label_desc: Use image node_id 8 for calling the TestParameterShiftLogic obj's underlying member method code with example usage: obj.test_force_order2(mocker) without return types