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])
  
      dev = qml.device("default.qubit.legacy", wires=2)
  
      @qml.qnode(dev)
      def circuit():
          qml.PauliX(0)
          return MyMeasurement(wires=[0]), MyMeasurement(wires=[1])
  
      with pytest.raises(
          ValueError,
          match="Shots must be specified in the device to compute the measurement ",
      ):
          circuit()
  
file_path: pennylane/tests/measurements/legacy/test_measurements_legacy.py
imports: import pytest
  import pennylane
  from pennylane.measurements import ClassicalShadowMP, MeasurementProcess, MeasurementTransform, SampleMeasurement, SampleMP, Shots, StateMeasurement, StateMP, expval, var
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