class_docstr: Unit tests for the ``constant`` function.
class_docstr_tok: ["Unit","tests","for","the","``","constant","``","function","."]
docstr: Test that the ``constant`` function returns the input parameter only when t is inside
  the window.
docstr_tok: ["Test","that","the","``","constant","``","function","returns","the","input","parameter","only","when","t","is","inside","the","window","."]
code: def test_constant_returns_correct_value(self):
      """Test that the ``constant`` function returns the input parameter only when t is inside
      the window."""
      times = np.arange(0, 10, step=1e-2)
      scalar = 1.23
      for t in times:
          assert qml.pulse.constant(scalar, time=t) == scalar
  
imports: import inspect
  from functools import reduce
  import numpy
  import pytest
  import pennylane
  from pennylane.pulse import ParametrizedHamiltonian
label_desc: Use image node_id 2 for calling the TestConstant obj's underlying member method code with example usage: obj.test_constant_returns_correct_value() without return types