Skip to content

Commit

Permalink
scope
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 26, 2024
1 parent a6807f2 commit 7960822
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions python/tests/test_sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
)


@pytest.fixture
def simple_sbml_model():
"""Some testmodel"""
document = libsbml.SBMLDocument(3, 1)
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 7960822

Please sign in to comment.