Skip to content

Commit

Permalink
Add conditional skipping to Hessian-related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrhansk committed Sep 16, 2023
1 parent 230a9e6 commit 7d55881
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cyipopt/tests/unit/test_deriv_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import pytest


pre_3_14_13 = (
cyipopt.IPOPT_VERSION < (3, 14, 13)
)


def full_indices(shape):
def indices():
r, c = np.indices(shape)
Expand Down Expand Up @@ -114,7 +119,7 @@ def ensure_unrecoverable_exception(instance):
ensure_solve_status(instance, -100)


@pytest.mark.skip(reason="Not caught in Ipopt")
@pytest.mark.skipif(pre_3_14_13, reason="Not caught in Ipopt < (3,14,13)")
def test_solve_neg_jac(hs071_sparse_instance):
n = hs071_sparse_instance.n
m = hs071_sparse_instance.m
Expand All @@ -130,7 +135,7 @@ def jacobianstructure():
ensure_unrecoverable_exception(hs071_sparse_instance)


@pytest.mark.skip(reason="Not caught in Ipopt")
@pytest.mark.skipif(pre_3_14_13, reason="Not caught in Ipopt < (3,14,13)")
def test_solve_large_jac(hs071_sparse_instance):
n = hs071_sparse_instance.n
m = hs071_sparse_instance.m
Expand All @@ -149,7 +154,7 @@ def jacobianstructure():
ensure_unrecoverable_exception(hs071_sparse_instance)


@pytest.mark.skip(reason="Not caught in Ipopt")
@pytest.mark.skipif(pre_3_14_13, reason="Not caught in Ipopt < (3,14,13)")
def test_solve_wrong_jac_structure_size(hs071_sparse_instance):
n = hs071_sparse_instance.n
m = hs071_sparse_instance.m
Expand All @@ -161,7 +166,7 @@ def test_solve_wrong_jac_structure_size(hs071_sparse_instance):
ensure_unrecoverable_exception(hs071_sparse_instance)


@pytest.mark.skip(reason="Not caught in Ipopt")
@pytest.mark.skipif(pre_3_14_13, reason="Not caught in Ipopt < (3,14,13)")
def test_solve_wrong_jac_value_size(hs071_sparse_instance):
n = hs071_sparse_instance.n
m = hs071_sparse_instance.m
Expand Down

0 comments on commit 7d55881

Please sign in to comment.