class_docstr: Tests for the transform specs using the QNode
class_docstr_tok: ["Tests","for","the","transform","specs","using","the","QNode"]
code: def test_empty(self, diff_method, len_info):
      dev = qml.device("default.qubit", wires=1)
  
      @qml.qnode(dev, diff_method=diff_method)
      def circ():
          return qml.expval(qml.PauliZ(0))
  
      with (
          pytest.warns(
              UserWarning,
              match="gradient of a tape with no trainable parameters",
          )
          if diff_method == "parameter-shift"
          else nullcontext()
      ):
          info_func = qml.specs(circ)
          info = info_func()
      assert len(info) == len_info
  
      expected_resources = qml.resource.Resources(
          num_wires=1, gate_types=defaultdict(int)
      )
      assert info["resources"] == expected_resources
      assert info["num_observables"] == 1
      assert info["num_diagonalizing_gates"] == 0
      assert info["num_device_wires"] == 1
      assert info["diff_method"] == diff_method
      assert info["num_trainable_params"] == 0
      assert info["device_name"] == dev.name
  
      if diff_method == "parameter-shift":
          assert info["num_gradient_executions"] == 0
          assert (
              info["gradient_fn"]
              == "pennylane.gradients.parameter_shift.param_shift"
          )
  
file_path: pennylane/tests/resource/test_specs.py
imports: from typing import Sequence, Callable
  from collections import defaultdict
  from contextlib import nullcontext
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestSpecsTransform obj's underlying member method code with example usage: obj.test_empty(diff_method, len_info) and returns: qml