class_docstr: Tests for parameter gradient methods
docstr: Test that the expectation of a second-order observable forces
  the gradient method to use the second-order parameter-shift rule
docstr_tok: ["Test","that","the","expectation","of","a","second-order","observable","forces","the","gradient","method","to","use","the","second-order","parameter-shift","rule"]
code: def test_second_order_expectation(self):
      """Test that the expectation of a second-order observable forces
      the gradient method to use the second-order parameter-shift rule
      """
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.Rotation(1.0, wires=[0])
          qml.expval(qml.NumberOperator(0))  # second order
  
      tape = qml.tape.QuantumScript.from_queue(q)
      assert _grad_method_cv(tape, 0) == "A2"
  
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 7 for calling the TestGradAnalysis obj's underlying member method code with example usage: obj.test_second_order_expectation() without return types