class_docstr: Test that the transform integrates well with QNodes.
docstr: Test that an error is raised if a user tries to give a device argument to the
  transform when transformingn a qnode.
docstr_tok: ["Test","that","an","error","is","raised","if","a","user","tries","to","give","a","device","argument","to","the","transform","when","transformingn","a","qnode","."]
code: def test_custom_qnode_transform_error(self):
      """Test that an error is raised if a user tries to give a device argument to the
      transform when transformingn a qnode."""
  
      dev = qml.device("default.qubit")
  
      @qml.qnode(dev)
      def circ():
          qml.PauliX(0)
          qml.measure(0)
          return qml.probs()
  
      with pytest.raises(ValueError, match="Cannot provide a 'device'"):
          _ = qml.defer_measurements(circ, device=dev)
  
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 1 for calling the TestQNode obj's underlying member method code with example usage: obj.test_custom_qnode_transform_error() and returns: qml