From b9e9a7d57874f162e71ff318a4cfcf5cecd338f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20Brand=C3=A3o?= Date: Thu, 28 Dec 2023 18:58:16 +0000 Subject: [PATCH] az debug: using options instead of environment variables --- amplpy/tests/TestBase.py | 6 ++++-- amplpy/tests/test_ampl.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/amplpy/tests/TestBase.py b/amplpy/tests/TestBase.py index 70d3f0d..0616420 100644 --- a/amplpy/tests/TestBase.py +++ b/amplpy/tests/TestBase.py @@ -15,9 +15,11 @@ class TestBase(unittest.TestCase): def setUp(self): print("Method:", self._testMethodName) - os.environ["solver"] = "highs" - os.environ["highs_options"] = "outlev=1" + # os.environ["solver"] = "highs" + # os.environ["highs_options"] = "outlev=1" self.ampl = amplpy.AMPL() + self.ampl["solver"] = "highs" + self.ampl["highs_options"] = "outlev=1" self.dirpath = tempfile.mkdtemp() def _tmpfile(self, filename): diff --git a/amplpy/tests/test_ampl.py b/amplpy/tests/test_ampl.py index bbb83c3..baa08f3 100644 --- a/amplpy/tests/test_ampl.py +++ b/amplpy/tests/test_ampl.py @@ -397,6 +397,8 @@ def test_solve_arguments(self): ampl.option["highs_options"] = "" self.assertEqual(ampl.option["highs_options"], "") + print(">>>", ampl.get_output("option highs_options;")) + output = ampl.solve(solver="highs", return_output=True) print("output1:", output) self.assertFalse("outlev" in output)