code: def test_qnode_mid_circuit_measurement_not_deferred_device_api(
      mocker,
  ):
      """Test that a circuit containing mid-circuit measurements is not transformed by the drawer
      to use deferred measurements if the device uses the new device API.
      """
  
      @qml.qnode(qml.device("default.qubit"))
      def circ():
          qml.PauliX(0)
          qml.measure(0)
          return qml.probs(wires=0)
  
      draw_qnode = qml.draw_mpl(circ)
      spy = mocker.spy(qml.defer_measurements, "_transform")
  
      _ = draw_qnode()
      spy.assert_not_called()
  
imports: import pytest
  import pennylane
label_desc: Use image node_id 8 for calling a global function with example usage: test_qnode_mid_circuit_measurement_not_deferred_device_api(mocker) and returns: qml