class_docstr: Test that the transform integrates well with QNodes.
docstr: Test that a quantum function that only contains one mid-circuit
  measurement yields the correct results and is transformed correctly.
docstr_tok: ["Test","that","a","quantum","function","that","only","contains","one","mid-circuit","measurement","yields","the","correct","results","and","is","transformed","correctly","."]
code: def test_only_mcm(self):
      """Test that a quantum function that only contains one mid-circuit
      measurement yields the correct results and is transformed correctly.
      """
      dev = qml.device("default.qubit", wires=3)
  
      @qml.defer_measurements
      @qml.qnode(dev)
      def qnode1():
          return qml.expval(qml.PauliZ(0))
  
      @qml.qnode(dev)
      @qml.defer_measurements
      def qnode2():
          qml.measure(1)
          return qml.expval(qml.PauliZ(0))
  
      res1 = qnode1()
      res2 = qnode2()
      assert res1 == res2
      assert isinstance(res1, type(res2))
      assert res1.shape == res2.shape
  
      assert len(qnode2.qtape.operations) == 0
      assert len(qnode1.qtape.measurements) == len(
          qnode2.qtape.measurements
      )
  
      # Check the measurements
      for op1, op2 in zip(
          qnode1.qtape.measurements, qnode2.qtape.measurements
      ):
          assert isinstance(op1, type(op2))
          assert op1.data == op2.data
  
imports: import math
  import pytest
  import pennylane
  from pennylane.measurements import MidMeasureMP, MeasurementValue
  import pennylane.numpy
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 2 for calling the TestQNode obj's underlying member method code with example usage: obj.test_only_mcm() and returns: qml, qml