Skip to content

Commit 2e21053

Browse files
committed
Update tests to track changes in the LegacySolverWrapper
1 parent 7f0f300 commit 2e21053

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

pyomo/contrib/solver/tests/solvers/test_ipopt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_ipopt_config(self):
4848
self.assertIsInstance(config.executable, ExecutableData)
4949

5050
# Test custom initialization
51-
solver = SolverFactory('ipopt_v2', executable='/path/to/exe')
51+
solver = SolverFactory('ipopt', executable='/path/to/exe')
5252
self.assertFalse(solver.config.tee)
5353
self.assertTrue(solver.config.executable.startswith('/path'))
5454

pyomo/contrib/solver/tests/unit/test_base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_context_manager(self):
178178

179179
class TestLegacySolverWrapper(unittest.TestCase):
180180
def test_class_method_list(self):
181-
expected_list = ['available', 'license_is_valid', 'solve']
181+
expected_list = ['available', 'config_block', 'license_is_valid', 'set_options', 'solve']
182182
method_list = [
183183
method
184184
for method in dir(base.LegacySolverWrapper)
@@ -207,9 +207,7 @@ def test_map_config(self):
207207
self.assertTrue(instance.config.tee)
208208
self.assertFalse(instance.config.load_solutions)
209209
self.assertEqual(instance.config.time_limit, 20)
210-
# Report timing shouldn't be created because it no longer exists
211-
with self.assertRaises(AttributeError):
212-
print(instance.config.report_timing)
210+
self.assertEqual(instance.config.report_timing, True)
213211
# Keepfiles should not be created because we did not declare keepfiles on
214212
# the original config
215213
with self.assertRaises(AttributeError):

0 commit comments

Comments
 (0)