diff --git a/python/tests/test_sbml_import.py b/python/tests/test_sbml_import.py index b09257d3a1..424deef89a 100644 --- a/python/tests/test_sbml_import.py +++ b/python/tests/test_sbml_import.py @@ -22,7 +22,6 @@ ) -@pytest.fixture def simple_sbml_model(): """Some testmodel""" document = libsbml.SBMLDocument(3, 1) @@ -45,9 +44,9 @@ def simple_sbml_model(): return document, model -def test_sbml2amici_no_observables(simple_sbml_model): +def test_sbml2amici_no_observables(): """Test model generation works for model without observables""" - sbml_doc, sbml_model = simple_sbml_model + sbml_doc, sbml_model = simple_sbml_model() sbml_importer = SbmlImporter(sbml_source=sbml_model, from_file=False) model_name = "test_sbml2amici_no_observables" with TemporaryDirectory() as tmpdir: @@ -64,9 +63,9 @@ def test_sbml2amici_no_observables(simple_sbml_model): @skip_on_valgrind -def test_sbml2amici_nested_observables_fail(simple_sbml_model): +def test_sbml2amici_nested_observables_fail(): """Test model generation works for model without observables""" - sbml_doc, sbml_model = simple_sbml_model + sbml_doc, sbml_model = simple_sbml_model() sbml_importer = SbmlImporter(sbml_source=sbml_model, from_file=False) model_name = "test_sbml2amici_nested_observables_fail" with TemporaryDirectory() as tmpdir: @@ -84,8 +83,8 @@ def test_sbml2amici_nested_observables_fail(simple_sbml_model): ) -def test_nosensi(simple_sbml_model): - sbml_doc, sbml_model = simple_sbml_model +def test_nosensi(): + sbml_doc, sbml_model = simple_sbml_model() sbml_importer = SbmlImporter(sbml_source=sbml_model, from_file=False) model_name = "test_nosensi" with TemporaryDirectory() as tmpdir: @@ -111,8 +110,8 @@ def test_nosensi(simple_sbml_model): @pytest.fixture(scope="session") -def observable_dependent_error_model(simple_sbml_model): - sbml_doc, sbml_model = simple_sbml_model +def observable_dependent_error_model(): + sbml_doc, sbml_model = simple_sbml_model() # add parameter and rate rule sbml_model.getSpecies("S1").setInitialConcentration(1.0) sbml_model.getParameter("p1").setValue(0.2) @@ -695,9 +694,9 @@ def test_code_gen_uses_lhs_symbol_ids(): @skip_on_valgrind -def test_hardcode_parameters(simple_sbml_model): +def test_hardcode_parameters(): """Test model generation works for model without observables""" - sbml_doc, sbml_model = simple_sbml_model + sbml_doc, sbml_model = simple_sbml_model() sbml_importer = SbmlImporter(sbml_source=sbml_model, from_file=False) r = sbml_model.createRateRule() r.setVariable("S1")