class_docstr: Check errors invovling copy, deepcopy, and comparison.
class_docstr_tok: ["Check","errors","invovling","copy",",","deepcopy",",","and","comparison","."]
docstr: Test an operator that cannot be compared with standard qml.equal.
docstr_tok: ["Test","an","operator","that","can","not","be","compared","with","standard","qml.equal","."]
code: def test_bad_comparison(self):
      """Test an operator that cannot be compared with standard qml.equal."""
  
      class BadComparison(Operator):
          def __init__(self, wires, val):
              self.hyperparameters["val"] = val
              super().__init__(wires)
  
      with pytest.raises(
          ValueError,
          match=r"The truth value of an array with more than one",
      ):
          assert_valid(BadComparison(0, val=np.eye(2)))
  
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 1 for calling the TestBadCopyComparison obj's underlying member method code with example usage: obj.test_bad_comparison() without return types