class_docstr: Tests involving matrix validation.
class_docstr_tok: ["Tests","involving","matrix","validation","."]
docstr: Test an error is raised if the matrix is not a TensorLike
docstr_tok: ["Test","an","error","is","raised","if","the","matrix","is","not","a","TensorLike"]
code: def test_matrix_not_tensorlike(self):
      """Test an error is raised if the matrix is not a TensorLike"""
  
      class BadMat(Operator):
          @staticmethod
          def compute_matrix():
              return "a"
  
      with pytest.raises(
          AssertionError, match=r"matrix must be a TensorLike"
      ):
          assert_valid(BadMat(0), skip_pickle=True)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.operation import Operator
  from pennylane.ops.functions import assert_valid
label_desc: Use image node_id 3 for calling the TestBadMatrix obj's underlying member method code with example usage: obj.test_matrix_not_tensorlike() and returns: str