class_docstr: Tests for the sample function
class_docstr_tok: ["Tests","for","the","sample","function"]
docstr: Test the return type and shape of sampling a single wire
docstr_tok: ["Test","the","return","type","and","shape","of","sampling","a","single","wire"]
code: def test_single_wire_sample(self, mocker):
      """Test the return type and shape of sampling a single wire"""
      n_sample = 10
  
      dev = qml.device("default.qubit.legacy", wires=1, shots=n_sample)
      spy = mocker.spy(qml.QubitDevice, "sample")
  
      @qml.qnode(dev)
      def circuit():
          qml.RX(0.54, wires=0)
          return qml.sample(qml.PauliZ(0))
  
      result = circuit()
  
      assert isinstance(result, np.ndarray)
      assert np.array_equal(result.shape, (n_sample,))
      assert circuit._qfunc_output.shape(dev, Shots(n_sample)) == (
          n_sample,
      )
  
      custom_measurement_process(dev, spy)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementShapeError, Sample, Shots, MeasurementValue
  from pennylane.operation import Operator
label_desc: Use image node_id 6 for calling the TestSample obj's underlying member method code with example usage: obj.test_single_wire_sample(mocker) and returns: qml