From e0226b07879c1647f682dd9aaf4f43ad50bb09c1 Mon Sep 17 00:00:00 2001 From: Daniel Laky <29078718+djlaky@users.noreply.github.com> Date: Mon, 12 Aug 2024 11:56:31 -0400 Subject: [PATCH] Update pyomo/contrib/doe/tests/test_doe_build.py Co-authored-by: Bethany Nicholson --- pyomo/contrib/doe/tests/test_doe_build.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyomo/contrib/doe/tests/test_doe_build.py b/pyomo/contrib/doe/tests/test_doe_build.py index 8d31b21ee81..78ad3b16ed9 100644 --- a/pyomo/contrib/doe/tests/test_doe_build.py +++ b/pyomo/contrib/doe/tests/test_doe_build.py @@ -265,14 +265,14 @@ def test_reactor_fd_central_design_fixing(self): continue con_name = con_name_base + str(ind) - assert hasattr(model, con_name) + self.assertTrue(hasattr(model, con_name)) # Ensure that each set of constraints has all blocks pairs with scenario 0 # i.e., (0, 1), (0, 2), ..., (0, N) --> N - 1 constraints - assert len(getattr(model, con_name)) == (len(model.scenarios) - 1) + self.assertEqual(len(getattr(model, con_name)), (len(model.scenarios) - 1)) # Should not have any constraints sets beyond the length of design_vars - 1 (started with index 0) - assert not hasattr(model, con_name_base + str(len(design_vars))) + self.assertFalse(hasattr(model, con_name_base + str(len(design_vars)))) def test_reactor_fd_backward_design_fixing(self): fd_method = "backward"