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 reversible differentiation.
docstr_tok: ["Tests","that","the","device","reports","correctly","whether","it","supports","reversible","differentiation","."]
code: def test_returns_probs(self, device_kwargs):
      """Tests that the device reports correctly whether it supports reversible differentiation."""
      device_kwargs["wires"] = 1
      dev = qml.device(**device_kwargs)
      cap = dev.capabilities()
  
      if "returns_probs" not in cap:
          pytest.skip(
              "No returns_probs capability specified by device."
          )
  
      @qml.qnode(dev)
      def circuit():
          if cap["model"] == "qubit":
              qml.PauliX(wires=0)
          else:
              qml.QuadX(wires=0)
          return qml.probs(wires=0)
  
      if cap["returns_probs"]:
          circuit()
      else:
          with pytest.raises(NotImplementedError):
              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 6 for calling the TestCapabilities obj's underlying member method code with example usage: obj.test_returns_probs(device_kwargs) and returns: qml