class_docstr: Test that the transform integrates well with QNodes.
docstr: Test that the defer_measurements transform works well even with
  tensor observables in the tape.
docstr_tok: ["Test","that","the","defer_measurements","transform","works","well","even","with","tensor","observables","in","the","tape","."]
code: def test_measure_with_tensor_obs(self, mid_measure_wire, tp_wires):
      """Test that the defer_measurements transform works well even with
      tensor observables in the tape."""
      # pylint: disable=protected-access
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.measure(mid_measure_wire)
          qml.expval(
              qml.operation.Tensor(*[qml.PauliZ(w) for w in tp_wires])
          )
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tape, _ = qml.defer_measurements(tape)
      tape = tape[0]
      # Check the operations and measurements in the tape
      assert len(tape.measurements) == 1
  
      measurement = tape.measurements[0]
      assert isinstance(
          measurement, qml.measurements.MeasurementProcess
      )
  
      tensor = measurement.obs
      assert len(tensor.obs) == 3
  
      for idx, ob in enumerate(tensor.obs):
          assert isinstance(ob, qml.PauliZ)
          assert ob.wires == qml.wires.Wires(tp_wires[idx])
  
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 12 for calling the TestQNode obj's underlying member method code with example usage: obj.test_measure_with_tensor_obs(mid_measure_wire, tp_wires) without return types