class_docstr: Test that single measurements return behavior does not change.
class_docstr_tok: ["Test","that","single","measurements","return","behavior","does","not","change","."]
docstr: Test the sample measurement.
docstr_tok: ["Test","the","sample","measurement","."]
code: def test_sample(self, measurement, interface, shots):
      """Test the sample measurement."""
      if shots is None:
          pytest.skip("Sample requires finite shots.")
  
      dev = qml.device("default.qubit", wires=2, shots=shots)
  
      def circuit(x):
          qml.Hadamard(wires=[0])
          qml.CRX(x, wires=[0, 1])
          return qml.apply(measurement)
  
      qnode = qml.QNode(circuit, dev)
      qnode.construct([0.5], {})
  
      res = qml.execute(
          tapes=[qnode.tape],
          device=dev,
          gradient_fn=None,
          interface=interface,
      )
  
      assert isinstance(res[0], (np.ndarray, np.float64))
      assert res[0].shape == (shots,)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementProcess
label_desc: Use image node_id 8 for calling the TestSingleReturnExecute obj's underlying member method code with example usage: obj.test_sample(measurement, interface, shots) and returns: qml