class_docstr: Test the private helpers for preprocessing.
class_docstr_tok: ["Test","the","private","helpers","for","preprocessing","."]
docstr: Test that a device error is raised if the operator cant be decomposed and doesn't have a matrix.
docstr_tok: ["Test","that","a","device","error","is","raised","if","the","operator","cant","be","decomposed","and","does","n't","have","a","matrix","."]
code: def test_error_from_unsupported_operation(self):
      """Test that a device error is raised if the operator cant be decomposed and doesn't have a matrix."""
      op = NoMatNoDecompOp("a")
      with pytest.raises(
          DeviceError,
          match=r"not supported on abc and does",
      ):
          tuple(
              _operator_decomposition_gen(
                  op,
                  lambda op: op.has_matrix,
                  self.decomposer,
                  name="abc",
              )
          )
  
imports: import pytest
  import pennylane
  from pennylane.operation import Operation
  from pennylane.tape import QuantumScript
  from pennylane import DeviceError
  from pennylane.devices.preprocess import no_sampling, validate_device_wires, validate_multiprocessing_workers, validate_adjoint_trainable_params, _operator_decomposition_gen, decompose, validate_observables, validate_measurements
label_desc: Use image node_id 5 for calling the TestPrivateHelpers obj's underlying member method code with example usage: obj.test_error_from_unsupported_operation() without return types