class_docstr: Tests for the SampleMeasurement class.
class_docstr_tok: ["Tests","for","the","SampleMeasurement","class","."]
docstr: Test the execution of a custom state measurement.
code: def test_custom_state_measurement(self, device):
      """Test the execution of a custom state measurement."""
      dev = device(2)
      _skip_test_for_braket(dev)
  
      if dev.shots is not None:
          pytest.skip(
              "Some plugins don't update state information when shots is not None."
          )
  
      class MyMeasurement(StateMeasurement):
          """Dummy state measurement."""
  
          def process_state(self, state, wire_order):
              return 1
  
      @qml.qnode(dev)
      def circuit():
          qml.PauliX(0)
          return MyMeasurement()
  
      assert circuit() == 1
  
imports: import pytest
  from flaky import flaky
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ClassicalShadowMP, MeasurementTransform, SampleMeasurement, SampleMP, StateMeasurement, StateMP
label_desc: Use image node_id 1 for calling the TestStateMeasurement obj's underlying member method code with example usage: obj.test_custom_state_measurement(device) and returns: MyMeasurement, int