code: def test_init_bounds():
      """Tests to make sure that initial bounds are consistent.
  
      Only for specific cases not tested above with the initializations of the
      Parameter class.
  
      """
      # test 1: min > max; should swap min and max
      par = lmfit.Parameter(name="a", value=0.0, min=10.0, max=-10.0)
      assert par.min == -10.0
      assert par.max == 10.0
  
      # test 2: min == max; should raise a ValueError
      msg = r"Parameter 'a' has min == max"
      with pytest.raises(ValueError, match=msg):
          par = lmfit.Parameter(name="a", value=0.0, min=10.0, max=10.0)
  
      # FIXME: ideally this should be impossible to happen ever....
      # perhaps we should add a  setter method for MIN and MAX as well?
      # test 3: max or min is equal to None
      par.min = None
      par._init_bounds()
      assert par.min == -np.inf
  
      par.max = None
      par._init_bounds()
      assert par.max == np.inf
  
imports: from math import trunc
  import pickle
  import numpy
  from numpy.testing import assert_allclose
  import pytest
  import lmfit
label_desc: Use image node_id 6 for calling a global function with example usage: test_init_bounds() without return types