code: def test_same_min_max(strategy):
      warnings.simplefilter("always")
      X = np.array([[1, -2], [1, -1], [1, 0], [1, 1]])
      est = KBinsDiscretizer(
          strategy=strategy, n_bins=3, encode="ordinal"
      )
      warning_message = (
          "Feature 0 is constant and will be replaced with 0."
      )
      with pytest.warns(UserWarning, match=warning_message):
          est.fit(X)
      assert est.n_bins_[0] == 1
      # replace the feature with zeros
      Xt = est.transform(X)
      assert_array_equal(Xt[:, 0], np.zeros(X.shape[0]))
  
imports: import warnings
  import numpy
  import pytest
  import scipy.sparse
  from sklearn import clone
  from sklearn.preprocessing import KBinsDiscretizer, OneHotEncoder
  from sklearn.utils._testing import assert_allclose, assert_allclose_dense_sparse, assert_array_almost_equal, assert_array_equal
label_desc: Use image node_id 8 for calling a global function with example usage: test_same_min_max(strategy) without return types