Skip to content

Commit 0cc34a6

Browse files
committed
move uno check in tests
1 parent 320bfcd commit 0cc34a6

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

cvxpy/tests/nlp_tests/test_nlp_solvers.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ def test_portfolio_opt_sum_multiply(self, solver):
144144
checker = DerivativeChecker(problem)
145145
checker.run_and_assert()
146146

147-
@pytest.mark.skipif('UNO' in INSTALLED_SOLVERS, reason='UNO has an algorithmic error')
148147
def test_rosenbrock(self, solver):
148+
if solver == 'UNO':
149+
pytest.skip('UNO has an algorithmic error')
149150
x = cp.Variable(2, name='x')
150151
objective = cp.Minimize((1 - x[0])**2 + 100 * (x[1] - x[0]**2)**2)
151152
problem = cp.Problem(objective, [])
@@ -356,11 +357,12 @@ def test_circle_packing_formulation_one(self, solver):
356357
checker = DerivativeChecker(problem)
357358
checker.run_and_assert()
358359

359-
@pytest.mark.skipif('UNO' in INSTALLED_SOLVERS, reason='UNO finds a KKT point with worse obj')
360360
def test_circle_packing_formulation_two(self, solver):
361361
"""Using norm_inf. This test revealed a very subtle bug in the unpacking of
362362
the ipopt solution. Some variables were mistakenly reordered. It was fixed
363363
in https://github.com/cvxgrp/cvxpy-ipopt/pull/82"""
364+
if solver == 'UNO':
365+
pytest.skip('UNO finds a KKT point with worse obj')
364366
rng = np.random.default_rng(5)
365367
n = 3
366368
radius = rng.uniform(1.0, 3.0, n)
@@ -424,8 +426,9 @@ def test_circle_packing_formulation_three(self, solver):
424426
checker = DerivativeChecker(prob)
425427
checker.run_and_assert()
426428

427-
@pytest.mark.skipif('UNO' in INSTALLED_SOLVERS, reason='UNO reaches iteration limit')
428429
def test_geo_mean(self, solver):
430+
if solver == 'UNO':
431+
pytest.skip('UNO reaches iteration limit')
429432
x = cp.Variable(3, nonneg=True)
430433
geo_mean = cp.geo_mean(x)
431434
objective = cp.Maximize(geo_mean)
@@ -438,8 +441,9 @@ def test_geo_mean(self, solver):
438441
checker = DerivativeChecker(problem)
439442
checker.run_and_assert()
440443

441-
@pytest.mark.skipif('UNO' in INSTALLED_SOLVERS, reason='UNO reaches iteration limit')
442444
def test_geo_mean2(self, solver):
445+
if solver == 'UNO':
446+
pytest.skip('UNO reaches iteration limit')
443447
p = np.array([.07, .12, .23, .19, .39])
444448
x = cp.Variable(5, nonneg=True)
445449
prob = cp.Problem(cp.Maximize(cp.geo_mean(x, p)), [cp.sum(x) <= 1])

0 commit comments

Comments
 (0)