class_docstr: Tests for the var function
class_docstr_tok: ["Tests","for","the","var","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.legacy", wires=1)
      res = qml.var(obs)
      # pylint: disable=use-implicit-booleaness-not-comparison
      assert res.shape(dev, Shots(None)) == ()
      assert res.shape(dev, Shots(100)) == ()
  
file_path: pennylane/tests/measurements/legacy/test_var_legacy.py
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import Variance, Shots
  from pennylane.devices.qubit.measure import flatten_state
label_desc: Use image node_id 6 for calling the TestVar obj's underlying member method code with example usage: obj.test_shape(obs) without return types