diff --git a/python/tests/petab/test_petab_problem.py b/python/tests/petab/test_petab_problem.py index 7b5ee1ca08..5a8a299bb9 100644 --- a/python/tests/petab/test_petab_problem.py +++ b/python/tests/petab/test_petab_problem.py @@ -1,7 +1,9 @@ from amici.petab.petab_problem import PetabProblem from benchmark_models_petab import get_problem +from amici.testing import skip_on_valgrind +@skip_on_valgrind def test_amici_petab_problem_pregenerate(): """PetabProblem with pre-generated ExpDatas""" # any example is fine - the only assumption is that we don't have @@ -29,6 +31,7 @@ def test_amici_petab_problem_pregenerate(): assert edata.parameters[0] == 0.12345 +@skip_on_valgrind def test_amici_petab_problem_on_demand(): """PetabProblem with on-demand ExpDatas""" # any example is fine - the only assumption is that we don't have @@ -64,6 +67,7 @@ def test_amici_petab_problem_on_demand(): ) +@skip_on_valgrind def test_amici_petab_problem_pregenerate_equals_on_demand(): """Check that PetabProblem produces the same ExpDatas independent of the `store_edatas` parameter.""" diff --git a/python/tests/test_antimony_import.py b/python/tests/test_antimony_import.py index 41af014aa9..44f8296c29 100644 --- a/python/tests/test_antimony_import.py +++ b/python/tests/test_antimony_import.py @@ -2,8 +2,10 @@ import numpy as np from amici.antimony_import import antimony2amici from amici.testing import TemporaryDirectoryWinSafe as TemporaryDirectory +from amici.testing import skip_on_valgrind +@skip_on_valgrind def test_antimony_example(): """If this example requires changes, please also update documentation/python_interface.rst.""" ant_model = """ diff --git a/python/tests/test_compare_conservation_laws_sbml.py b/python/tests/test_compare_conservation_laws_sbml.py index 4d6a453b52..640d2dd988 100644 --- a/python/tests/test_compare_conservation_laws_sbml.py +++ b/python/tests/test_compare_conservation_laws_sbml.py @@ -5,6 +5,7 @@ import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal +from amici.testing import skip_on_valgrind @pytest.fixture @@ -123,6 +124,7 @@ def get_results( return amici.runAmiciSimulation(model, solver, edata) +@skip_on_valgrind def test_compare_conservation_laws_sbml(models, edata_fixture): # first, create the model model_with_cl, model_without_cl = models @@ -288,6 +290,7 @@ def test_adjoint_pre_and_post_equilibration(models, edata_fixture): assert_allclose(raa_cl["sllh"], raa["sllh"], 1e-5, 1e-5) +@skip_on_valgrind def test_get_set_model_settings(models): """test amici.(get|set)_model_settings cycles for models with and without conservation laws""" diff --git a/python/tests/test_cxxcodeprinter.py b/python/tests/test_cxxcodeprinter.py index 384b8ad9ae..3f92a5495c 100644 --- a/python/tests/test_cxxcodeprinter.py +++ b/python/tests/test_cxxcodeprinter.py @@ -1,8 +1,10 @@ import sympy as sp from amici.cxxcodeprinter import AmiciCxxCodePrinter from sympy.codegen.rewriting import optims_c99 +from amici.testing import skip_on_valgrind +@skip_on_valgrind def test_optimizations(): """Check that AmiciCxxCodePrinter handles optimizations correctly.""" try: diff --git a/python/tests/test_de_model.py b/python/tests/test_de_model.py index 7dec534da9..8bd750443a 100644 --- a/python/tests/test_de_model.py +++ b/python/tests/test_de_model.py @@ -1,8 +1,10 @@ import sympy as sp from amici.de_model import Event from amici.import_utils import amici_time_symbol +from amici.testing import skip_on_valgrind +@skip_on_valgrind def test_event_trigger_time(): e = Event( sp.Symbol("event1"), "event name", amici_time_symbol - 10, sp.Float(0) diff --git a/python/tests/test_ode_export.py b/python/tests/test_ode_export.py index b30d451a4a..f34d78892d 100644 --- a/python/tests/test_ode_export.py +++ b/python/tests/test_ode_export.py @@ -93,6 +93,7 @@ def test_csc_matrix_vector(): assert str(sparse_matrix) == "Matrix([[0], [da2_db_1]])" +@skip_on_valgrind def test_match_deriv(): from amici.de_export import DERIVATIVE_PATTERN as pat diff --git a/python/tests/test_pandas.py b/python/tests/test_pandas.py index 21c58bcaff..40799120ad 100644 --- a/python/tests/test_pandas.py +++ b/python/tests/test_pandas.py @@ -5,6 +5,8 @@ import amici import numpy as np import pytest +from amici.testing import skip_on_valgrind + # test parameters for test_pandas_import_export combos = itertools.product([(10, 5), (5, 10), ()], repeat=3) @@ -18,6 +20,7 @@ ] +@skip_on_valgrind @pytest.mark.parametrize("case", cases) def test_pandas_import_export(sbml_example_presimulation_module, case): """TestCase class for testing csv import using pandas""" diff --git a/python/tests/test_petab_objective.py b/python/tests/test_petab_objective.py index 6464865c46..5d29ad88ff 100755 --- a/python/tests/test_petab_objective.py +++ b/python/tests/test_petab_objective.py @@ -10,6 +10,7 @@ import pytest from amici.petab.petab_import import import_petab_problem from amici.petab.simulations import SLLH, simulate_petab +from amici.testing import skip_on_valgrind # Absolute and relative tolerances for finite difference gradient checks. ATOL: float = 1e-3 @@ -29,6 +30,7 @@ def lotka_volterra() -> petab.Problem: ) +@skip_on_valgrind def test_simulate_petab_sensitivities(lotka_volterra): petab_problem = lotka_volterra amici_model = import_petab_problem(petab_problem) diff --git a/python/tests/test_rdata.py b/python/tests/test_rdata.py index ac7659f363..8e0f78655e 100644 --- a/python/tests/test_rdata.py +++ b/python/tests/test_rdata.py @@ -4,6 +4,7 @@ import pytest from amici.numpy import evaluate from numpy.testing import assert_almost_equal, assert_array_equal +from amici.testing import skip_on_valgrind @pytest.fixture(scope="session") @@ -19,6 +20,7 @@ def rdata_by_id_fixture(sbml_example_presimulation_module): return model, rdata +@skip_on_valgrind def test_rdata_by_id(rdata_by_id_fixture): model, rdata = rdata_by_id_fixture @@ -42,6 +44,7 @@ def test_rdata_by_id(rdata_by_id_fixture): ) +@skip_on_valgrind def test_evaluate(rdata_by_id_fixture): # get IDs of model components model, rdata = rdata_by_id_fixture diff --git a/python/tests/test_sbml_import.py b/python/tests/test_sbml_import.py index 7c4a67c0a2..aa343dfcc3 100644 --- a/python/tests/test_sbml_import.py +++ b/python/tests/test_sbml_import.py @@ -654,6 +654,7 @@ def _test_set_parameters_by_dict(model_module): assert model.getParameters() == old_parameter_values +@skip_on_valgrind @pytest.mark.parametrize("extract_cse", [True, False]) def test_code_gen_uses_cse(extract_cse): """Check that code generation honors AMICI_EXTRACT_CSE""" @@ -675,6 +676,7 @@ def test_code_gen_uses_cse(extract_cse): os.environ = old_environ +@skip_on_valgrind def test_code_gen_uses_lhs_symbol_ids(): """Check that code generation uses symbol IDs instead of plain array indices""" @@ -691,6 +693,7 @@ def test_code_gen_uses_lhs_symbol_ids(): assert "dobservable_x1_dx1 = " in dwdx +@skip_on_valgrind def test_hardcode_parameters(simple_sbml_model): """Test model generation works for model without observables""" sbml_doc, sbml_model = simple_sbml_model