class_docstr: Test that the device declares its capabilities correctly.
class_docstr_tok: ["Test","that","the","device","declares","its","capabilities","correctly","."]
docstr: Tests that the device reports correctly whether it supports tensor observables.
docstr_tok: ["Tests","that","the","device","reports","correctly","whether","it","supports","tensor","observables","."]
code: def test_supports_tensor_observables(self, device_kwargs):
      """Tests that the device reports correctly whether it supports tensor observables."""
      device_kwargs["wires"] = 2
      dev = qml.device(**device_kwargs)
      cap = dev.capabilities()
  
      if "supports_tensor_observables" not in cap:
          pytest.skip(
              "No supports_tensor_observables capability specified by device."
          )
  
      @qml.qnode(dev)
      def circuit():
          """Model agnostic quantum function with tensor observable"""
          if cap["model"] == "qubit":
              qml.PauliX(wires=0)
          else:
              qml.QuadX(wires=0)
          return qml.expval(
              qml.Identity(wires=0) @ qml.Identity(wires=1)
          )
  
      if cap["supports_tensor_observables"]:
          circuit()
      else:
          with pytest.raises(qml.QuantumFunctionError):
              circuit()
  
file_path: pennylane/pennylane/devices/tests/test_properties.py
imports: import pytest
  import pennylane.numpy
  import pennylane
  from pennylane._device import DeviceError
label_desc: Use image node_id 4 for calling the TestCapabilities obj's underlying member method code with example usage: obj.test_supports_tensor_observables(device_kwargs) and returns: qml