class_docstr: Tests for parameter gradient methods
docstr: Test that an exception is raised if an operator has a
  grad method defined that the CV parameter-shift tape
  doesn't recognize
docstr_tok: ["Test","that","an","exception","is","raised","if","an","operator","has","a","grad","method","defined","that","the","CV","parameter-shift","tape","does","n't","recognize"]
code: def test_unknown_op_grad_method(self, monkeypatch):
      """Test that an exception is raised if an operator has a
      grad method defined that the CV parameter-shift tape
      doesn't recognize"""
      monkeypatch.setattr(qml.Rotation, "grad_method", "B")
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.Rotation(1.0, wires=0)
          qml.expval(qml.QuadX(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      with pytest.raises(ValueError, match="unknown gradient method"):
          _grad_method_cv(tape, 0)
  
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 TestGradAnalysis obj's underlying member method code with example usage: obj.test_unknown_op_grad_method(monkeypatch) without return types