class_docstr: Test for the dispatching logic of the parameter shift method
docstr: Test that if a device does not support PolyXP
  and the variance parameter-shift rule is required,
  we fallback to finite differences.
docstr_tok: ["Test","that","if","a","device","does","not","support","PolyXP","and","the","variance","parameter-shift","rule","is","required",",","we","fallback","to","finite","differences","."]
code: def test_no_poly_xp_support_variance(self, mocker, monkeypatch):
      """Test that if a device does not support PolyXP
      and the variance parameter-shift rule is required,
      we fallback to finite differences."""
      spy = mocker.spy(
          qml.gradients.parameter_shift_cv, "var_param_shift"
      )
      dev = qml.device("default.gaussian", wires=1)
  
      monkeypatch.delitem(dev._observable_map, "PolyXP")
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.Rotation(1.0, wires=[0])
          qml.var(qml.QuadX(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tape.trainable_params = {0}
  
      with pytest.warns(
          UserWarning, match="does not support the PolyXP observable"
      ):
          qml.gradients.param_shift_cv(tape, dev)
  
      spy.assert_not_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 11 for calling the TestParameterShiftLogic obj's underlying member method code with example usage: obj.test_no_poly_xp_support_variance(mocker, monkeypatch) without return types