class_docstr: Tests for the expval function
class_docstr_tok: ["Tests","for","the","expval","function"]
docstr: Test that the shape is correct.
docstr_tok: ["Test","that","the","shape","is","correct","."]
code: def test_shape(self, obs):
      """Test that the shape is correct."""
      dev = qml.device("default.qubit", wires=1)
  
      res = qml.expval(obs)
      # pylint: disable=use-implicit-booleaness-not-comparison
      assert res.shape(dev, Shots(None)) == ()
      assert res.shape(dev, Shots(100)) == ()
  
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 8 for calling the TestExpval obj's underlying member method code with example usage: obj.test_shape(obs) without return types