class_docstr: Test the pauli_sentence function.
docstr: Test that Tensors of non-Pauli ops raise error when cast to a PauliSentence.
docstr_tok: ["Test","that","Tensors","of","non-Pauli","ops","raise","error","when","cast","to","a","PauliSentence","."]
code: def test_tensor_raises_error(self):
      """Test that Tensors of non-Pauli ops raise error when cast to a PauliSentence."""
      h_mat = np.array([[1, 1], [1, -1]])
      h_op = qml.Hermitian(h_mat, wires=1)
      op = qml.PauliX(wires=0) @ h_op
  
      with pytest.raises(
          ValueError, match="Op must be a linear combination of"
      ):
          pauli_sentence(op)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.operation import Tensor
  from pennylane.ops import Identity, PauliX, PauliY, PauliZ
  from pennylane.pauli import pauli_sentence, PauliWord, PauliSentence
  from pennylane.pauli.conversion import _generalized_pauli_decompose
label_desc: Use image node_id 3 for calling the TestPauliSentence obj's underlying member method code with example usage: obj.test_tensor_raises_error() without return types