diff --git a/autotest/test_gwf_libmf6_evt01.py b/autotest/test_gwf_libmf6_evt01.py index 8495e2c87da..a0d73f5452f 100644 --- a/autotest/test_gwf_libmf6_evt01.py +++ b/autotest/test_gwf_libmf6_evt01.py @@ -9,7 +9,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_evt01"] @@ -150,6 +150,8 @@ def head2et_wellrate(h): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + name = cases[idx].upper() if model_ws is None: model_ws = "." @@ -249,6 +251,7 @@ def api_func(exe, idx, model_ws=None): return True, open(output_file_path).readlines() +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwf_libmf6_ghb01.py b/autotest/test_gwf_libmf6_ghb01.py index 6d6644ee722..1131920d683 100644 --- a/autotest/test_gwf_libmf6_ghb01.py +++ b/autotest/test_gwf_libmf6_ghb01.py @@ -11,7 +11,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_ghb01"] @@ -180,6 +180,8 @@ def api_ghb_pak(hcof, rhs): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + name = cases[idx].upper() if model_ws is None: model_ws = "." @@ -273,6 +275,7 @@ def api_func(exe, idx, model_ws=None): return True, open(output_file_path).readlines() +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwf_libmf6_ifmod01.py b/autotest/test_gwf_libmf6_ifmod01.py index ecb3d37bf59..be2ffe00cae 100644 --- a/autotest/test_gwf_libmf6_ifmod01.py +++ b/autotest/test_gwf_libmf6_ifmod01.py @@ -17,7 +17,7 @@ import flopy import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_ifmod01"] name_left = "leftmodel" @@ -207,6 +207,8 @@ def build_models(idx, test): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + if model_ws is None: model_ws = "." output_file_path = os.path.join(model_ws, "mfsim.stdout") @@ -303,6 +305,7 @@ def check_interface_models(mf6): ), "AREA in interface model does not match" +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwf_libmf6_ifmod02.py b/autotest/test_gwf_libmf6_ifmod02.py index 4e135aae110..b5b612ce9d0 100644 --- a/autotest/test_gwf_libmf6_ifmod02.py +++ b/autotest/test_gwf_libmf6_ifmod02.py @@ -42,7 +42,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_ifmod02"] @@ -303,6 +303,8 @@ def build_models(idx, test): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + if model_ws is None: model_ws = "." @@ -401,6 +403,7 @@ def check_interface_models(mf6): ) +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) @pytest.mark.developmode def test_mf6model(idx, name, function_tmpdir, targets): diff --git a/autotest/test_gwf_libmf6_ifmod03.py b/autotest/test_gwf_libmf6_ifmod03.py index a58d46aed8c..03821d7eff9 100644 --- a/autotest/test_gwf_libmf6_ifmod03.py +++ b/autotest/test_gwf_libmf6_ifmod03.py @@ -32,7 +32,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_ifmod03"] @@ -220,6 +220,8 @@ def build_models(idx, test): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + if model_ws is None: model_ws = "." @@ -287,6 +289,7 @@ def check_interface_models(mf6): assert abs(ymax - ymin) < 1e-6 +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwf_libmf6_rch01.py b/autotest/test_gwf_libmf6_rch01.py index 6ae6a64e5c6..0b46dafb93d 100644 --- a/autotest/test_gwf_libmf6_rch01.py +++ b/autotest/test_gwf_libmf6_rch01.py @@ -13,7 +13,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_rch01"] @@ -147,6 +147,8 @@ def build_models(idx, test): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + name = cases[idx].upper() if model_ws is None: model_ws = "." @@ -229,6 +231,7 @@ def api_func(exe, idx, model_ws=None): return True, open(output_file_path).readlines() +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwf_libmf6_rch02.py b/autotest/test_gwf_libmf6_rch02.py index 9907d9a9d29..5b7193d58fe 100644 --- a/autotest/test_gwf_libmf6_rch02.py +++ b/autotest/test_gwf_libmf6_rch02.py @@ -10,7 +10,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_rch02"] @@ -180,6 +180,8 @@ def run_perturbation(mf6, max_iter, recharge, tag, rch): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + print("\nBMI implementation test:") name = cases[idx].upper() @@ -304,6 +306,7 @@ def api_func(exe, idx, model_ws=None): return True, open(output_file_path).readlines() +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwf_libmf6_riv01.py b/autotest/test_gwf_libmf6_riv01.py index a8384e1c959..14f64c19cad 100644 --- a/autotest/test_gwf_libmf6_riv01.py +++ b/autotest/test_gwf_libmf6_riv01.py @@ -9,7 +9,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_riv01"] @@ -153,6 +153,8 @@ def build_models(idx, test): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + name = cases[idx].upper() if model_ws is None: model_ws = "." @@ -246,6 +248,7 @@ def api_func(exe, idx, model_ws=None): return True, open(output_file_path).readlines() +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwf_libmf6_riv02.py b/autotest/test_gwf_libmf6_riv02.py index b4c3933f29b..db875ac90a2 100644 --- a/autotest/test_gwf_libmf6_riv02.py +++ b/autotest/test_gwf_libmf6_riv02.py @@ -9,7 +9,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_riv02"] @@ -167,6 +167,8 @@ def api_riv_pak(stage, h, hcof, rhs): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + name = cases[idx].upper() if model_ws is None: model_ws = "." @@ -271,6 +273,7 @@ def api_func(exe, idx, model_ws=None): return True, open(output_file_path).readlines() +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework( diff --git a/autotest/test_gwf_libmf6_sto01.py b/autotest/test_gwf_libmf6_sto01.py index 1cafb36e550..198978744f9 100644 --- a/autotest/test_gwf_libmf6_sto01.py +++ b/autotest/test_gwf_libmf6_sto01.py @@ -10,7 +10,7 @@ import numpy as np import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg cases = ["libgwf_sto01"] @@ -150,6 +150,8 @@ def build_models(idx, test): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + name = cases[idx].upper() if model_ws is None: model_ws = "." @@ -205,6 +207,7 @@ def api_func(exe, idx, model_ws=None): return True, open(output_file_path).readlines() +@requires_pkg("modflowapi") @pytest.mark.slow @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): diff --git a/autotest/test_prt_libmf6_budget.py b/autotest/test_prt_libmf6_budget.py index a2d6c53f809..8ccb5d4d4b7 100644 --- a/autotest/test_prt_libmf6_budget.py +++ b/autotest/test_prt_libmf6_budget.py @@ -7,7 +7,7 @@ import pytest from framework import TestFramework -from modflowapi import ModflowApi +from modflow_devtools.markers import requires_pkg from test_prt_budget import ( HorizontalCase, build_mp7_sim, @@ -44,6 +44,8 @@ def build_models(idx, test): def api_func(exe, idx, model_ws=None): + from modflowapi import ModflowApi + name = cases[idx].upper() if model_ws is None: model_ws = Path(".") @@ -97,6 +99,7 @@ def api_func(exe, idx, model_ws=None): return True, open(output_file_path).readlines() +@requires_pkg("modflowapi") @pytest.mark.parametrize("idx, name", enumerate(cases)) def test_mf6model(idx, name, function_tmpdir, targets): test = TestFramework(