class_docstr: Unit tests for compile function.
class_docstr_tok: ["Unit","tests","for","compile","function","."]
docstr: Test that error is raised for an invalid function in the pipeline
docstr_tok: ["Test","that","error","is","raised","for","an","invalid","function","in","the","pipeline"]
code: def test_compile_invalid_pipeline(self):
      """Test that error is raised for an invalid function in the pipeline"""
      qfunc = build_qfunc([0, 1, 2])
  
      transformed_qfunc = compile(
          qfunc, pipeline=[cancel_inverses, isinstance]
      )
      transformed_qnode = qml.QNode(transformed_qfunc, dev_3wires)
  
      with pytest.raises(
          ValueError, match="Invalid transform function"
      ):
          transformed_qnode(0.1, 0.2, 0.3)
  
imports: from functools import partial
  import pytest
  from test_optimization.utils import compare_operation_lists
  import pennylane
  from pennylane import numpy
  from pennylane.wires import Wires
  from pennylane.transforms.compile import compile
  from pennylane.transforms import unitary_to_rot
  from pennylane.transforms.optimization import cancel_inverses, commute_controlled, merge_rotations, single_qubit_fusion
  from pennylane.transforms.optimization.optimization_utils import _fuse_global_phases
label_desc: Use image node_id 1 for calling the TestCompile obj's underlying member method code with example usage: obj.test_compile_invalid_pipeline() without return types