class_docstr: Test for measurement expansion
class_docstr_tok: ["Test","for","measurement","expansion"]
docstr: Check that an exception is raised if the measurement to
  be expanded has no observable
docstr_tok: ["Check","that","an","exception","is","raised","if","the","measurement","to","be","expanded","has","no","observable"]
code: def test_expand_no_observable(self):
      """Check that an exception is raised if the measurement to
      be expanded has no observable"""
      with pytest.raises(DecompositionUndefinedError):
          ProbabilityMP(wires=qml.wires.Wires([0, 1])).expand()
  
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 3 for calling the TestExpansion obj's underlying member method code with example usage: obj.test_expand_no_observable() without return types