class_docstr: Tests the layering function
class_docstr_tok: ["Tests","the","layering","function"]
docstr: Tests that the layering function is yielding the correct sequence of gates
docstr_tok: ["Tests","that","the","layering","function","is","yielding","the","correct","sequence","of","gates"]
code: def test_layer(self, unitary, depth, arguments, keywords, gates):
      """Tests that the layering function is yielding the correct sequence of gates"""
  
      with qml.tape.OperationRecorder() as rec:
          layer(unitary, depth, *arguments, **keywords)
  
      for i, gate in enumerate(rec.operations):
          prep = [gate.name, gate.parameters, gate.wires]
          target = [gates[i].name, gates[i].parameters, gates[i].wires]
  
      assert prep == target
  
file_path: pennylane/tests/templates/test_layer.py
imports: import pytest
  import pennylane
  from pennylane import layer
label_desc: Use image node_id 2 for calling the TestLayer obj's underlying member method code with example usage: obj.test_layer(unitary, depth, arguments, keywords, gates) without return types