class_docstr: Test addition and inclusion of operations and subclasses in attributes.
docstr: Test that an error is raised if we try to add something
  other than an Operation or a string.
docstr_tok: ["Test","that","an","error","is","raised","if","we","try","to","add","something","other","than","an","Operation","or","a","string","."]
code: def test_invalid_addition(self):
      """Test that an error is raised if we try to add something
      other than an Operation or a string."""
      with pytest.raises(
          TypeError, match="can be added to an attribute"
      ):
          new_attribute.add(0)
  
      assert len(new_attribute) == 5
  
      with pytest.raises(
          TypeError, match="can be added to an attribute"
      ):
          new_attribute.add(object())
  
      assert len(new_attribute) == 5
  
imports: import itertools
  import pytest
  import numpy
  from scipy.stats import unitary_group
  import pennylane
  from pennylane.ops.qubit.attributes import Attribute, has_unitary_generator
  from pennylane.operation import AnyWires
label_desc: Use image node_id 6 for calling the TestAttribute obj's underlying member method code with example usage: obj.test_invalid_addition() without return types