class_docstr: Tests for the SampleMeasurement class.
class_docstr_tok: ["Tests","for","the","SampleMeasurement","class","."]
docstr: Test that executing a sampled measurement with ``shots=None`` raises an error.
docstr_tok: ["Test","that","executing","a","sampled","measurement","with","``","shots=None","``","raises","an","error","."]
code: def test_sample_measurement_without_shots(self):
      """Test that executing a sampled measurement with ``shots=None`` raises an error."""
  
      class MyMeasurement(SampleMeasurement):
          # pylint: disable=signature-differs
          def process_samples(
              self, samples, wire_order, shot_range, bin_size
          ):
              return qml.math.sum(samples[..., self.wires])
  
          @property
          def return_type(self):
              return Sample
  
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev)
      def circuit():
          qml.PauliX(0)
          return MyMeasurement(wires=[0]), MyMeasurement(wires=[1])
  
      with pytest.raises(
          qml.DeviceError,
          match="not accepted for analytic simulation on default.qubit",
      ):
          circuit()
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import ClassicalShadowMP, Counts, CountsMP, Expectation, ExpectationMP, MeasurementProcess, MeasurementTransform, MeasurementValue, MidMeasure, MidMeasureMP, MutualInfoMP, PurityMP, Probability, ProbabilityMP, Sample, SampleMeasurement, SampleMP, ShadowExpvalMP, Shots, State, StateMeasurement, StateMP, Variance, VarianceMP, VnEntropyMP, expval, sample, var
  from pennylane.operation import DecompositionUndefinedError
  from pennylane.queuing import AnnotatedQueue
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the TestSampleMeasurement obj's underlying member method code with example usage: obj.test_sample_measurement_without_shots() and returns: MyMeasurement,  MyMeasurement, qml, Sample