Skip to content

Commit

Permalink
[Py] skip CasADi tests if compiled without CasADi support
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Feb 14, 2024
1 parent b834823 commit a26cbb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/test/test_alm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import alpaqa as pa
import numpy as np
from pprint import pprint
import pytest


@pytest.mark.skipif(not pa.with_casadi, reason="requires CasADi")
def test_alm():
import alpaqa.casadi_loader as cl

Expand Down Expand Up @@ -59,6 +62,7 @@ def test_alm():
assert np.linalg.norm(y - [0, -2/3]) < 1e-5


@pytest.mark.skipif(not pa.with_casadi, reason="requires CasADi")
def test_alm_pyapi_compile():
import casadi as cs

Expand Down Expand Up @@ -97,6 +101,7 @@ def test_alm_pyapi_compile():
assert np.linalg.norm(y - [0, -2/3]) < 1e-5


@pytest.mark.skipif(not pa.with_casadi, reason="requires CasADi")
def test_alm_pyapi_build():
import casadi as cs

Expand Down
1 change: 1 addition & 0 deletions python/test/test_alm_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os


@pytest.mark.skipif(not pa.with_casadi, reason="requires CasADi")
def test_alm_threaded():
valgrind = 'valgrind' in os.getenv('LD_PRELOAD', '')

Expand Down

0 comments on commit a26cbb9

Please sign in to comment.