class_docstr: Tests for the sample function
class_docstr_tok: ["Tests","for","the","sample","function"]
docstr: Test that the appropriate error is raised with no shots are specified
docstr_tok: ["Test","that","the","appropriate","error","is","raised","with","no","shots","are","specified"]
code: def test_shape_no_shots_error(self):
      """Test that the appropriate error is raised with no shots are specified"""
      dev = qml.device("default.qubit.legacy", wires=2, shots=None)
      shots = Shots(None)
      mp = qml.sample()
  
      with pytest.raises(
          MeasurementShapeError,
          match="Shots are required to obtain the shape of the measurement",
      ):
          _ = mp.shape(dev, shots)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementShapeError, Sample, Shots, MeasurementValue
  from pennylane.operation import Operator
label_desc: Use image node_id 15 for calling the TestSample obj's underlying member method code with example usage: obj.test_shape_no_shots_error() without return types