Skip to content

Commit

Permalink
[ModelBuilder] fix test with SCIP OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Jul 22, 2023
1 parent fad3e41 commit 49c8f26
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ortools/linear_solver/python/model_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def run_minimal_linear_example(self, solver_name):
self.assertEqual(-math.inf, c2.lower_bound)

solver = mb.ModelSolver(solver_name)
if not solver.solver_is_supported():
print(f'Solver {solver_name} is not supported')
return
self.assertTrue(pd.isna(solver.value(x1)))
self.assertTrue(pd.isna(solver.value(x2)))
self.assertTrue(pd.isna(solver.value(x3)))
Expand Down Expand Up @@ -1687,6 +1690,9 @@ def test_solve_status(
objective_expression=objective_expression,
)
model_solver = mb.ModelSolver(solver["name"])
if not model_solver.solver_is_supported():
print(f'Solver {solver["name"]} is not supported')
return
if solver.get("solver_specific_parameters"):
model_solver.set_solver_specific_parameters(
solver.get("solver_specific_parameters")
Expand Down Expand Up @@ -1753,6 +1759,9 @@ def test_get_variable_values(
objective_expression=objective_expression,
)
model_solver = mb.ModelSolver(solver["name"])
if not model_solver.solver_is_supported():
print(f'Solver {solver["name"]} is not supported')
return
if solver.get("solver_specific_parameters"):
model_solver.set_solver_specific_parameters(
solver.get("solver_specific_parameters")
Expand Down Expand Up @@ -1828,6 +1837,9 @@ def test_get_objective_value(
objective_expression=objective_expression,
)
model_solver = mb.ModelSolver(solver["name"])
if not model_solver.solver_is_supported():
print(f'Solver {solver["name"]} is not supported')
return
if solver.get("solver_specific_parameters"):
model_solver.set_solver_specific_parameters(
solver.get("solver_specific_parameters")
Expand Down

0 comments on commit 49c8f26

Please sign in to comment.