class_docstr: Test that the QNode correctly changes shot value, and
  remains differentiable.
class_docstr_tok: ["Test","that","the","QNode","correctly","changes","shot","value",",","and","remains","differentiable","."]
docstr: Test that temporarily setting the shots works
  for gradient computations
docstr_tok: ["Test","that","temporarily","setting","the","shots","works","for","gradient","computations"]
code: def test_gradient_integration(self, interface):
      """Test that temporarily setting the shots works
      for gradient computations"""
      dev = qml.device("default.qubit.legacy", wires=2, shots=1)
      a, b = jax.numpy.array([0.543, -0.654])
  
      @qnode(
          dev,
          diff_method=qml.gradients.param_shift,
          interface=interface,
      )
      def cost_fn(a, b):
          qml.RY(a, wires=0)
          qml.RX(b, wires=1)
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliY(1))
  
      res = jax.grad(cost_fn, argnums=[0, 1])(a, b, shots=30000)
      assert dev.shots == 1
  
      expected = [np.sin(a) * np.sin(b), -np.cos(a) * np.cos(b)]
      assert np.allclose(res, expected, atol=0.1, rtol=0)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import qnode
  from pennylane.tape import QuantumScript
label_desc: Use image node_id 3 for calling the TestShotsIntegration obj's underlying member method code with example usage: obj.test_gradient_integration(interface) and returns: qml