Skip to content

Commit

Permalink
cvxpy/tests/test_conic_solvers.py: Fix test for coin-or/CyLP#150
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Mar 16, 2022
1 parent a166fc8 commit ba9a4d1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cvxpy/tests/test_conic_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,11 @@ def setUp(self) -> None:
self.B = cp.Variable((2, 2), name='B')
self.C = cp.Variable((3, 2), name='C')

def _cylp_has_isProvenInfeasible():
def _cylp_checks_isProvenInfeasible():
try:
from cylp.cy.CyCbcModel import CyCbcModel
return hasattr(CyCbcModel, 'isProvenInfeasible')
# https://github.com/coin-or/CyLP/pull/150
from cylp.cy.CyCbcModel import problemStatus
return problemStatus[0] == 'search completed'
except ImportError:
return False

Expand Down Expand Up @@ -647,7 +648,7 @@ def test_cbc_mi_lp_2(self) -> None:
def test_cbc_mi_lp_3(self) -> None:
StandardTestLPs.test_mi_lp_3(solver='CBC')

@unittest.skipUnless(_cylp_has_isProvenInfeasible(),
@unittest.skipUnless(_cylp_checks_isProvenInfeasible(),
'CyLP <= 0.91.4 has no working integer infeasibility detection')
def test_cbc_mi_lp_5(self) -> None:
StandardTestLPs.test_mi_lp_5(solver='CBC')
Expand Down

0 comments on commit ba9a4d1

Please sign in to comment.