From 96f94bcadefbbc05ae246b92a9e4bb7cba294272 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Fri, 21 Mar 2025 13:11:05 -0700 Subject: [PATCH] change mathopt test until pybind11_abseil is fixed --- ortools/math_opt/core/python/solver_test.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ortools/math_opt/core/python/solver_test.py b/ortools/math_opt/core/python/solver_test.py index 821c148f7b..9894072d37 100644 --- a/ortools/math_opt/core/python/solver_test.py +++ b/ortools/math_opt/core/python/solver_test.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys import threading from typing import Callable, Optional, Sequence from absl.testing import absltest @@ -111,8 +112,12 @@ class PybindSolverTest(parameterized.TestCase): # Add invalid variable id to cause MathOpt model validation error. model.objective.linear_coefficients.ids.append(7) model.objective.linear_coefficients.values.append(2.0) - with self.assertRaisesRegex(StatusNotOk, "id 7 not found"): - _solve_model(model, use_solver_class=use_solver_class) + if sys.platform in ("darwin", "win32"): + with self.assertRaisesRegex(RuntimeError, "id 7 not found"): + _solve_model(model, use_solver_class=use_solver_class) + else: + with self.assertRaisesRegex(StatusNotOk, "id 7 not found"): + _solve_model(model, use_solver_class=use_solver_class) @parameterized.named_parameters( dict(testcase_name="without_solver", use_solver_class=False),