class_docstr: Tests for the expval function
class_docstr_tok: ["Tests","for","the","expval","function"]
docstr: Test that expectation values for mid-circuit measurement values
  are correct for a single measurement value.
docstr_tok: ["Test","that","expectation","values","for","mid-circuit","measurement","values","are","correct","for","a","single","measurement","value","."]
code: def test_observable_is_measurement_value(
      self, shots, phi, tol, tol_stochastic
  ):  # pylint: disable=too-many-arguments
      """Test that expectation values for mid-circuit measurement values
      are correct for a single measurement value."""
      dev = qml.device("default.qubit", wires=2, shots=shots)
  
      @qml.qnode(dev)
      def circuit(phi):
          qml.RX(phi, 0)
          m0 = qml.measure(0)
          return qml.expval(m0)
  
      res = circuit(phi)
  
      atol = tol if shots is None else tol_stochastic
      assert np.allclose(
          np.array(res), np.sin(phi / 2) ** 2, atol=atol, rtol=0
      )
  
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 4 for calling the TestExpval obj's underlying member method code with example usage: obj.test_observable_is_measurement_value(shots, phi, tol, tol_stochastic) and returns: qml