class_docstr: Tests for the _transform_observable method
docstr: An exception should be raised if the observable is higher than 2nd order.
docstr_tok: ["An","exception","should","be","raised","if","the","observable","is","higher","than","2nd","order","."]
code: def test_higher_order_observable(self, monkeypatch):
      """An exception should be raised if the observable is higher than 2nd order."""
      monkeypatch.setattr(qml.QuadP, "ev_order", 3)
  
      with pytest.raises(
          NotImplementedError, match="order > 2 not implemented"
      ):
          _transform_observable(
              qml.QuadP(0), np.identity(3), device_wires=[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 2 for calling the TestTransformObservable obj's underlying member method code with example usage: obj.test_higher_order_observable(monkeypatch) without return types