class_docstr: Test the methods and attributes of the Resource class
docstr: Test that an error is raised if we try to set any attribute.
docstr_tok: ["Test","that","an","error","is","raised","if","we","try","to","set","any","attribute","."]
code: def test_set_attributes_error(self):
      """Test that an error is raised if we try to set any attribute."""
      r = Resources()
      attr_lst = [
          "num_wires",
          "num_gates",
          "depth",
          "shots",
          "gate_types",
      ]
  
      for attr_name in attr_lst:
          with pytest.raises(
              FrozenInstanceError, match="cannot assign to field"
          ):
              setattr(r, attr_name, 1)
  
imports: from dataclasses import FrozenInstanceError
  from collections import defaultdict
  import pytest
  import pennylane
  from pennylane.operation import Operation
  from pennylane.tape import QuantumScript
  from pennylane.resource.resource import Resources, ResourcesOperation, _count_resources
  from pennylane.measurements import Shots
label_desc: Use image node_id 2 for calling the TestResources obj's underlying member method code with example usage: obj.test_set_attributes_error() without return types