Skip to content

Commit

Permalink
fix: skip scipy tests when scipy is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengzl18 committed Nov 27, 2023
1 parent cda2ea6 commit 553bdd9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cyipopt/tests/unit/test_dual_warm_start.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import sys
import pytest
import numpy as np
from numpy.testing import assert_, assert_allclose
from cyipopt import minimize_ipopt


@pytest.mark.skipif("scipy" not in sys.modules,
reason="Test only valid if Scipy available.")
class TestDualWarmStart:
atol = 1e-7

Expand Down Expand Up @@ -89,7 +92,7 @@ def test_dual_warm_start_equality_with_right(self):
options=self.opts, mult_g=[1], mult_x_L=[1, 1], mult_x_U=[-1, -1])
assert_(res['success'], res['message'])
assert_allclose(res.x, [1, 1])

@pytest.mark.xfail(raises=(ValueError,), reason="Initial guesses for dual variables have wrong shape")
def test_dual_warm_start_equality_with_wrong_shape(self):
# equality constraint, with wrong warm start shape.
Expand Down

0 comments on commit 553bdd9

Please sign in to comment.