class_docstr: Tests for the expval function
class_docstr_tok: ["Tests","for","the","expval","function"]
docstr: Test that the expval interface works
docstr_tok: ["Test","that","the","expval","interface","works"]
code: def test_value(self, tol, shots):
      """Test that the expval interface works"""
      dev = qml.device("default.qubit", wires=2, shots=shots)
  
      @qml.qnode(dev, diff_method="parameter-shift")
      def circuit(x):
          qml.RX(x, wires=0)
          return qml.expval(qml.PauliY(0))
  
      x = 0.54
      res = circuit(x)
      expected = -np.sin(x)
  
      atol = tol if shots is None else 0.05
      rtol = 0 if shots is None else 0.05
      assert np.allclose(res, expected, atol=atol, rtol=rtol)
  
      r_dtype = np.float64
      if isinstance(res, tuple):
          assert res[0].dtype == r_dtype
          assert res[1].dtype == r_dtype
      else:
          assert res.dtype == r_dtype
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane.measurements import Expectation, Shots
  from pennylane.measurements.expval import ExpectationMP
label_desc: Use image node_id 1 for calling the TestExpval obj's underlying member method code with example usage: obj.test_value(tol, shots) and returns: qml