From 20e419648f27448f6400b25cf9b0480f51a5f45c Mon Sep 17 00:00:00 2001 From: Bernard Knueven Date: Fri, 1 Mar 2024 12:24:05 -0700 Subject: [PATCH] fixing _get_constraint test --- pyomo/contrib/mis/__init__.py | 2 -- pyomo/contrib/mis/tests/test_mis.py | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pyomo/contrib/mis/__init__.py b/pyomo/contrib/mis/__init__.py index 5f652020dfa..0235c769467 100644 --- a/pyomo/contrib/mis/__init__.py +++ b/pyomo/contrib/mis/__init__.py @@ -10,5 +10,3 @@ # ___________________________________________________________________________ from pyomo.contrib.mis.mis import compute_infeasibility_explanation -# so the tests can find it -from pyomo.contrib.mis.mis import _get_constraint diff --git a/pyomo/contrib/mis/tests/test_mis.py b/pyomo/contrib/mis/tests/test_mis.py index 985bf1911d9..9948c665f26 100644 --- a/pyomo/contrib/mis/tests/test_mis.py +++ b/pyomo/contrib/mis/tests/test_mis.py @@ -12,6 +12,7 @@ import pyomo.common.unittest as unittest import pyomo.environ as pyo import pyomo.contrib.mis as mis +from pyomo.contrib.mis.mis import _get_constraint from pyomo.common.tempfiles import TempfileManager import logging @@ -42,9 +43,8 @@ def test_write_mis_ipopt(self): def test__get_constraint_errors(self): # A not-completely-cyincal way to get the coverage up. - m = _get_infeasible_model() # not modified, but who cares? - fct = getattr(mis, "_get_constraint") - # fct = mis._get_constraint + m = _get_infeasible_model() # not modified + fct = _get_constraint m.foo_slack_plus_ = pyo.Var() self.assertRaises(RuntimeError, fct, m, m.foo_slack_plus_)