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 changing shots works on execution
docstr_tok: ["Test","that","changing","shots","works","on","execution"]
code: def test_changing_shots(self, interface, mocker, tol):
      """Test that changing shots works on execution"""
      dev = qml.device("default.qubit.legacy", wires=2, shots=None)
      a, b = jax.numpy.array([0.543, -0.654])
  
      @qnode(
          dev,
          diff_method=qml.gradients.param_shift,
          interface=interface,
      )
      def circuit(a, b):
          qml.RY(a, wires=0)
          qml.RX(b, wires=1)
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliY(1))
  
      spy = mocker.spy(dev, "sample")
  
      # execute with device default shots (None)
      res = circuit(a, b)
      assert np.allclose(res, -np.cos(a) * np.sin(b), atol=tol, rtol=0)
      spy.assert_not_called()
  
      # execute with shots=100
      res = circuit(
          a, b, shots=100
      )  # pylint: disable=unexpected-keyword-arg
      spy.assert_called_once()
      assert spy.spy_return.shape == (100,)
  
      # device state has been unaffected
      assert dev.shots is None
      res = circuit(a, b)
      assert np.allclose(res, -np.cos(a) * np.sin(b), atol=tol, rtol=0)
      spy.assert_called_once()
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import qnode
  from pennylane.tape import QuantumScript
label_desc: Use image node_id 2 for calling the TestShotsIntegration obj's underlying member method code with example usage: obj.test_changing_shots(interface, mocker, tol) and returns: qml