class_docstr: Tests for the expval function
class_docstr_tok: ["Tests","for","the","expval","function"]
docstr: Test that the return type of the observable is :attr:`ObservableReturnTypes.Expectation`
docstr_tok: ["Test","that","the","return","type","of","the","observable","is",":","attr",":","`","ObservableReturnTypes.Expectation","`"]
code: def test_observable_return_type_is_expectation(self):
      """Test that the return type of the observable is :attr:`ObservableReturnTypes.Expectation`"""
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev)
      def circuit():
          res = qml.expval(qml.PauliZ(0))
          assert res.return_type is Expectation
          return res
  
      circuit()
  
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 3 for calling the TestExpval obj's underlying member method code with example usage: obj.test_observable_return_type_is_expectation() and returns: res