Skip to content

Commit

Permalink
more specific logging test
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbybp committed Aug 13, 2024
1 parent 6b377da commit 3eb40d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyomo/core/tests/transform/test_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,11 @@ def test_propagate_solution_uninitialized_variable(self):
pyo.TransformationFactory("core.scale_model").propagate_solution(
scaled_model, m
)
self.assertIn("replacing value of variable", OUTPUT.getvalue())
msg = (
"Variable with value None in the scaled model is replacing value of"
" variable x[2] in the original model with None (was 1.0).\n"
)
self.assertEqual(OUTPUT.getvalue(), msg)
self.assertAlmostEqual(m.x[1].value, 2.0, delta=1e-8)
# Note that value of x[2] in original model *has* been overridden to None.
# In this case, a warning has been raised.
Expand Down

0 comments on commit 3eb40d8

Please sign in to comment.