class_docstr: Test assertions involving decompositions.
class_docstr_tok: ["Test","assertions","involving","decompositions","."]
docstr: Test if has_decomposition is False but decomposition defined.
docstr_tok: ["Test","if","has_decomposition","is","False","but","decomposition","defined","."]
code: def test_error_not_raised(self):
      """Test if has_decomposition is False but decomposition defined."""
  
      class BadDecomp(Operator):
          @staticmethod
          def compute_decomposition(wires):
              return [qml.RY(2.3, 0)]
  
          has_decomposition = False
  
      with pytest.raises(
          AssertionError, match="If has_decomposition is False"
      ):
          assert_valid(BadDecomp(wires=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 5 for calling the TestDecompositionErrors obj's underlying member method code with example usage: obj.test_error_not_raised() and returns: list