Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 25, 2024
1 parent 8d9b827 commit a6807f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions python/tests/test_edata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import amici
import numpy as np
import pytest
from amici.testing import skip_on_valgrind
from test_sbml_import import model_units_module # noqa: F401


@skip_on_valgrind
@pytest.mark.usefixtures("model_units_module")
def test_edata_sensi_unscaling(model_units_module): # noqa: F811
"""
ExpData parameters should be used for unscaling initial state
Expand Down
15 changes: 12 additions & 3 deletions python/tests/test_sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import re
import sys
from numbers import Number
from pathlib import Path

Expand Down Expand Up @@ -109,7 +110,7 @@ def test_nosensi(simple_sbml_model):
assert rdata.status == amici.AMICI_ERROR


@pytest.fixture
@pytest.fixture(scope="session")
def observable_dependent_error_model(simple_sbml_model):
sbml_doc, sbml_model = simple_sbml_model
# add parameter and rate rule
Expand Down Expand Up @@ -776,13 +777,13 @@ def test_constraints():


@skip_on_valgrind
def test_same_extension_warning():
def test_same_extension_error():
"""Test for error when loading a model with the same extension name as an
already loaded model."""
from amici.antimony_import import antimony2amici

ant_model_1 = """
model test_same_extension_warning
model test_same_extension_error
species A = 0
p = 1
A' = p
Expand All @@ -807,6 +808,14 @@ def test_same_extension_warning():
module_name=module_name, module_path=outdir
)
assert model_module_1.get_model().getParameters()[0] == 1.0

# Try to import another model with the same name

# On Windows, this will give "permission denied" when building the
# extension
if sys.platform == "win32":
return

antimony2amici(
ant_model_2,
model_name=module_name,
Expand Down

0 comments on commit a6807f2

Please sign in to comment.