code: def test_inf_nan(self, bad_value):
      with pytest.raises(
          ValueError, match=r"detected in endog, estimation infeasible"
      ):
          endog = self.endog1.copy()
          endog[0] = bad_value
          _MinimalWLS(
              endog,
              self.exog1,
              self.weights1,
              check_endog=True,
              check_weights=True,
          ).fit()
  
      with pytest.raises(
          ValueError,
          match=r"detected in weights, estimation infeasible",
      ):
          weights = self.weights1.copy()
          weights[-1] = bad_value
          _MinimalWLS(
              self.endog1,
              self.exog1,
              weights,
              check_endog=True,
              check_weights=True,
          ).fit()
  
file_path: statsmodels/statsmodels/regression/tests/test_tools.py
imports: import numpy
  from numpy.testing import assert_allclose
  import pytest
  from statsmodels.regression.linear_model import WLS
  from statsmodels.regression._tools import _MinimalWLS
label_desc: Use image node_id 3 for calling the TestMinimalWLS obj's underlying member method code with example usage: obj.test_inf_nan(bad_value) without return types