class_docstr: Tests the layering function
class_docstr_tok: ["Tests","the","layering","function"]
docstr: Tests that the correct error is thrown when the length of an argument is incorrect
docstr_tok: ["Tests","that","the","correct","error","is","thrown","when","the","length","of","an","argument","is","incorrect"]
code: def test_args_length(self):
      """Tests that the correct error is thrown when the length of an argument is incorrect"""
  
      params = [1, 1]
  
      def unitary(param, wire):
          qml.RX(param, wires=wire)
  
      with pytest.raises(
          ValueError,
          match=r"Each positional argument must have length matching 'depth'; expected 3",
      ):
          layer(unitary, 3, params, wires=[0])
  
file_path: pennylane/tests/templates/test_layer.py
imports: import pytest
  import pennylane
  from pennylane import layer
label_desc: Use image node_id 1 for calling the TestLayer obj's underlying member method code with example usage: obj.test_args_length() without return types