Skip to content

Commit

Permalink
fix(test markers): add missing markers for exes required (#1577)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli authored Oct 7, 2022
1 parent 984227d commit aff3585
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 4 deletions.
4 changes: 3 additions & 1 deletion autotest/test_cbc_full3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np
import pytest
from autotest.conftest import get_example_data_path
from autotest.conftest import get_example_data_path, requires_exe

from flopy.mf6 import MFSimulation, ModflowGwfoc
from flopy.modflow import Modflow
Expand Down Expand Up @@ -119,6 +119,7 @@ def cbc_eval(cbcobj, nnodes, shape3d, modelgrid):
cobj_mg.close()


@requires_exe("mf6")
@pytest.mark.mf6
@pytest.mark.parametrize("path", mf6_paths)
def test_cbc_full3D_mf6(tmpdir, path):
Expand All @@ -142,6 +143,7 @@ def test_cbc_full3D_mf6(tmpdir, path):
cbc_eval(cbc, nnodes, shape3d, gwf.modelgrid)


@requires_exe("mf2005")
@pytest.mark.parametrize("path", mf2005_paths)
def test_cbc_full3D_mf2005(tmpdir, path):
ml = load_mf2005(path, str(tmpdir))
Expand Down
1 change: 1 addition & 0 deletions autotest/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@ def test_vtk_export_disu2_grid(tmpdir, example_data_path):


@pytest.mark.mf6
@requires_exe("mf6", "gridgen")
@requires_pkg("vtk", "shapefile")
def test_vtk_export_disu_model(tmpdir):
from vtkmodules.util.numpy_support import vtk_to_numpy
Expand Down
5 changes: 4 additions & 1 deletion autotest/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import matplotlib
import numpy as np
import pytest
from autotest.conftest import requires_pkg
from autotest.conftest import requires_pkg, requires_exe
from autotest.test_dis_cases import case_dis, case_disv
from autotest.test_grid_cases import GridCases
from flaky import flaky
Expand Down Expand Up @@ -773,6 +773,7 @@ def test_unstructured_complete_grid_ctor():


@requires_pkg("shapely")
@requires_exe("triangle")
def test_triangle_unstructured_grid(tmpdir):
maximum_area = 30000.0
extent = (214270.0, 221720.0, 4366610.0, 4373510.0)
Expand Down Expand Up @@ -805,6 +806,7 @@ def test_triangle_unstructured_grid(tmpdir):


@requires_pkg("shapely", "scipy")
@requires_exe("triangle")
def test_voronoi_vertex_grid(tmpdir):
xmin = 0.0
xmax = 2.0
Expand Down Expand Up @@ -832,6 +834,7 @@ def test_voronoi_vertex_grid(tmpdir):


@flaky
@requires_exe("triangle")
@requires_pkg("shapely", "scipy")
@parametrize_with_cases("grid_info", cases=GridCases, prefix="voronoi")
def test_voronoi_grid(request, tmpdir, grid_info):
Expand Down
1 change: 1 addition & 0 deletions autotest/test_modpathfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def mp7_large(module_tmpdir):
)


@requires_exe("mf6")
def test_pathline_file_sorts_in_ctor(tmpdir, module_tmpdir, mp7_small):
sim, forward_model_name, backward_model_name, nodew, nodesr = mp7_small
ws = tmpdir / "ws"
Expand Down
1 change: 1 addition & 0 deletions autotest/test_mp6.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ def make_mp_model(nm, m, ws, use_pandas):
return mp


@requires_exe("mf2005")
@parametrize_with_cases("ml", cases=Mp6Cases2)
def test_mp_wpandas_wo_pandas(ml):
"""
Expand Down
1 change: 1 addition & 0 deletions autotest/test_mp7.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ def test_endpoint_output(tmpdir):
# assert not np.allclose(t0, t1), msg


@requires_exe("mf6")
def test_pathline_plotting(tmpdir):
ml = Mp7Cases.mf6(tmpdir)
success, buff = ml.run_model()
Expand Down
2 changes: 2 additions & 0 deletions autotest/test_mt3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -17923,6 +17923,7 @@ def test_mt3dms_load_when_nam_dne():
Mt3dms.load("nonexistent.nam")


@requires_exe("mf2005")
def test_mt3d_ssm_with_nodata_in_1st_sp(tmpdir):
nlay, nrow, ncol = 3, 5, 5
perlen = np.zeros((10), dtype=float) + 10
Expand Down Expand Up @@ -18032,6 +18033,7 @@ def test_mt3d_ssm_with_nodata_in_1st_sp(tmpdir):
assert np.allclose(conca, concb)


@requires_exe("mf2005")
def test_none_spdtype(tmpdir):
# ensure that -1 and None work as valid list entries in the
# stress period dictionary
Expand Down
1 change: 1 addition & 0 deletions autotest/test_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def test_obs_single_time(tmpdir):
assert data["obs02"][0] == 20.0, "obs02[0] != 20.0"


@requires_exe("mf2005")
def test_obs_create_and_write(tmpdir, example_data_path):
"""
test041 create and write of MODFLOW-2005 OBS example problem
Expand Down
5 changes: 4 additions & 1 deletion autotest/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pytest
from autotest.conftest import requires_pkg
from autotest.conftest import requires_pkg, requires_exe
from flaky import flaky
from matplotlib import pyplot as plt
from matplotlib import rcParams
Expand Down Expand Up @@ -352,6 +352,7 @@ def test_model_dot_plot_export(tmpdir, example_data_path):


@requires_pkg("pandas")
@requires_exe("mf2005")
def test_pathline_plot_xc(tmpdir, example_data_path):
# test with multi-layer example
load_ws = example_data_path / "mp6"
Expand Down Expand Up @@ -465,6 +466,7 @@ def quasi3d_model(tmpdir):
return mf


@requires_exe("mf2005")
def test_map_plot_with_quasi3d_layers(quasi3d_model):
# read output
hf = HeadFile(
Expand All @@ -490,6 +492,7 @@ def test_map_plot_with_quasi3d_layers(quasi3d_model):
plt.savefig(os.path.join(str(quasi3d_model.model_ws), "plt01.png"))


@requires_exe("mf2005")
def test_cross_section_with_quasi3d_layers(quasi3d_model):
# read output
hf = HeadFile(
Expand Down
4 changes: 4 additions & 0 deletions autotest/test_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import pytest

from autotest.conftest import requires_exe
from flopy.mf6 import (
MFSimulation,
ModflowGwf,
Expand Down Expand Up @@ -31,6 +32,7 @@ def mf6_freyberg_path(example_data_path):


@pytest.mark.mf6
@requires_exe("mf6")
def test_faceflows(tmpdir, mf6_freyberg_path):
sim = MFSimulation.load(
sim_name="freyberg",
Expand Down Expand Up @@ -98,6 +100,7 @@ def test_faceflows(tmpdir, mf6_freyberg_path):


@pytest.mark.mf6
@requires_exe("mf6")
def test_flowja_residuals(tmpdir, mf6_freyberg_path):
sim = MFSimulation.load(
sim_name="freyberg",
Expand Down Expand Up @@ -145,6 +148,7 @@ def test_flowja_residuals(tmpdir, mf6_freyberg_path):


@pytest.mark.mf6
@requires_exe("mf6")
def test_structured_faceflows_3d(tmpdir):
name = "mymodel"
sim = MFSimulation(sim_name=name, sim_ws=str(tmpdir), exe_name="mf6")
Expand Down
2 changes: 2 additions & 0 deletions autotest/test_sfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ def test_assign_layers(tmpdir):
assert np.array_equal(l, np.array([1, 1]))


@requires_exe("mf2005")
@requires_pkg("pandas")
def test_SfrFile(tmpdir, sfr_examples_path, mf2005_model_path):
common_names = [
Expand Down Expand Up @@ -894,6 +895,7 @@ def test_sfrloadcheck(tmpdir, mf2005_model_path, i, case):
assert "segment elevations vs. model grid" in chk.warnings


@requires_exe("mfnwt")
@pytest.mark.parametrize("isfropt, icalc", get_test_matrix())
def test_isfropt_icalc(tmpdir, example_data_path, isfropt, icalc):
pth = example_data_path / "sfr_test"
Expand Down
1 change: 1 addition & 0 deletions autotest/test_uzf.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ def test_load_write_wel_option_line(tmpdir, options_path):
assert wel.iunitramp == 20


@requires_exe("mfnwt")
def test_uzf_negative_iuzfopt(tmpdir):
ml = Modflow(
modelname="uzf_neg",
Expand Down
4 changes: 3 additions & 1 deletion autotest/test_zonbud_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pytest
from autotest.conftest import requires_pkg
from autotest.conftest import requires_pkg, requires_exe

from flopy.mf6 import MFSimulation
from flopy.utils import ZoneBudget, ZoneBudget6, ZoneFile6
Expand Down Expand Up @@ -283,6 +283,7 @@ def test_read_zone_file(tmpdir):


@pytest.mark.mf6
@requires_exe("mf6")
@requires_pkg("pandas")
def test_zonebudget_6(tmpdir, example_data_path):
import pandas as pd
Expand Down Expand Up @@ -343,6 +344,7 @@ def test_zonebudget_6(tmpdir, example_data_path):


@pytest.mark.mf6
@requires_exe("mf6")
def test_zonebudget6_from_output_method(tmpdir, example_data_path):
exe_name = "mf6"
zb_exe_name = "zbud6"
Expand Down

0 comments on commit aff3585

Please sign in to comment.