class_docstr: Tests for the MeasurementTransform class.
class_docstr_tok: ["Tests","for","the","MeasurementTransform","class","."]
docstr: Test the execution of a custom measurement.
docstr_tok: ["Test","the","execution","of","a","custom","measurement","."]
code: def test_custom_measurement(self):
      """Test the execution of a custom measurement."""
  
      class CountTapesMP(MeasurementTransform, SampleMeasurement):
          def process(self, tape, device):
              program, _ = device.preprocess()
              tapes, _ = program([tape])
              return len(tapes)
  
          def process_samples(
              self, samples, wire_order, shot_range=None, bin_size=None
          ):
              return [True]
  
      dev = qml.device("default.qubit", wires=2, shots=1000)
  
      @qml.qnode(dev)
      def circuit():
          return CountTapesMP(wires=[0])
  
      assert circuit() == 1
  
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 1 for calling the TestMeasurementTransform obj's underlying member method code with example usage: obj.test_custom_measurement() and returns: CountTapesMP, len, list