class_docstr: Tests for the sample function
class_docstr_tok: ["Tests","for","the","sample","function"]
docstr: Test that the numeric type is correct.
docstr_tok: ["Test","that","the","numeric","type","is","correct","."]
code: def test_numeric_type(self, obs, exp):
      """Test that the numeric type is correct."""
      res = qml.sample(obs) if obs is not None else qml.sample()
      assert res.numeric_type is exp
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementShapeError, Sample, Shots
  from pennylane.operation import EigvalsUndefinedError, Operator
label_desc: Use image node_id 17 for calling the TestSample obj's underlying member method code with example usage: obj.test_numeric_type(obs, exp) without return types