Skip to content

Commit df45999

Browse files
committed
Exclude copt from nonconvex tests
1 parent 68f63fd commit df45999

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/test_quadratic_constraint.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,10 @@ def test_qc_mixed_linear_quad(
10251025
self, qc_mixed_model: Model, solver: str, io_api: str
10261026
) -> None:
10271027
"""Test QC with both quadratic and linear terms."""
1028+
# COPT does not handle this nonconvex constraint (x-1)² <= 0
1029+
if solver == "copt":
1030+
pytest.skip("COPT does not support this nonconvex constraint form")
1031+
10281032
status, condition = qc_mixed_model.solve(solver, io_api=io_api)
10291033
assert status == "ok"
10301034
assert condition == "optimal"
@@ -1038,9 +1042,9 @@ def test_qc_cross_terms(
10381042
self, qc_cross_terms_model: Model, solver: str, io_api: str
10391043
) -> None:
10401044
"""Test QC with cross product terms (xy) - nonconvex bilinear."""
1041-
# MOSEK does not support nonconvex problems
1042-
if solver == "mosek":
1043-
pytest.skip("MOSEK does not support nonconvex bilinear constraints")
1045+
# MOSEK and COPT do not support nonconvex problems
1046+
if solver in ("mosek", "copt"):
1047+
pytest.skip(f"{solver.upper()} does not support nonconvex bilinear constraints")
10441048

10451049
status, condition = qc_cross_terms_model.solve(solver, io_api=io_api)
10461050
assert status == "ok"
@@ -1063,9 +1067,9 @@ def test_qc_geq_constraint(
10631067
self, qc_geq_model: Model, solver: str, io_api: str
10641068
) -> None:
10651069
"""Test >= quadratic constraint - nonconvex."""
1066-
# MOSEK does not support nonconvex problems
1067-
if solver == "mosek":
1068-
pytest.skip("MOSEK does not support nonconvex >= quadratic constraints")
1070+
# MOSEK and COPT do not support nonconvex problems
1071+
if solver in ("mosek", "copt"):
1072+
pytest.skip(f"{solver.upper()} does not support nonconvex >= quadratic constraints")
10691073

10701074
status, condition = qc_geq_model.solve(solver, io_api=io_api)
10711075
assert status == "ok"

0 commit comments

Comments
 (0)