Skip to content

Commit

Permalink
test: mark tests requiring shapely (#2171)
Browse files Browse the repository at this point in the history
* use python 3.9 for example notebook tests in rtd.yml
  • Loading branch information
wpbonelli authored Apr 30, 2024
1 parent e50ab9a commit 50666a5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
cache: 'pip'
cache-dependency-path: pyproject.toml

Expand Down
4 changes: 2 additions & 2 deletions autotest/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ def test_vtk_add_model_without_packages_names(function_tmpdir):


@pytest.mark.mf6
@requires_pkg("vtk")
@requires_pkg("vtk", "shapely")
def test_vtk_export_disv1_model(function_tmpdir):
from vtkmodules.util.numpy_support import vtk_to_numpy
from vtkmodules.vtkIOLegacy import vtkUnstructuredGridReader
Expand Down Expand Up @@ -1779,7 +1779,7 @@ def test_vtk_export_disv1_model(function_tmpdir):


@pytest.mark.mf6
@requires_pkg("vtk")
@requires_pkg("vtk", "shapely")
def test_vtk_export_disv2_model(function_tmpdir):
from vtkmodules.util.numpy_support import vtk_to_numpy
from vtkmodules.vtkIOLegacy import vtkUnstructuredGridReader
Expand Down
3 changes: 3 additions & 0 deletions autotest/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ def test_grid_crs_exceptions():
sg.set_coord_info(prj=not_a_file)


@requires_pkg("shapely")
def test_tocvfd1():
vertdict = {}
vertdict[0] = [(0, 0), (100, 0), (100, 100), (0, 100), (0, 0)]
Expand All @@ -890,6 +891,7 @@ def test_tocvfd1():
assert 6 in iverts[0]


@requires_pkg("shapely")
def test_tocvfd2():
vertdict = {}
vertdict[0] = [(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)]
Expand All @@ -898,6 +900,7 @@ def test_tocvfd2():
assert [1, 4, 5, 6, 2, 1] in iverts


@requires_pkg("shapely")
def test_tocvfd3():
# create the nested grid described in the modflow-usg documentation

Expand Down
4 changes: 4 additions & 0 deletions autotest/test_gridutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import pytest
from modflow_devtools.markers import requires_pkg

from flopy.utils.gridutil import (
get_disu_kwargs,
Expand Down Expand Up @@ -61,6 +62,7 @@ def test_get_lni_infers_layer_count_when_int_ncpl(ncpl, nodes, expected):
assert ln == expected[i]


@requires_pkg("shapely")
@pytest.mark.parametrize(
"nlay, nrow, ncol, delr, delc, tp, botm",
[
Expand Down Expand Up @@ -123,6 +125,7 @@ def test_get_disu_kwargs(nlay, nrow, ncol, delr, delc, tp, botm):
# print(kwargs["nja"])


@requires_pkg("shapely")
@pytest.mark.parametrize(
"nlay, nrow, ncol, delr, delc, tp, botm",
[
Expand Down Expand Up @@ -160,6 +163,7 @@ def test_get_disv_kwargs(nlay, nrow, ncol, delr, delc, tp, botm):
# print(kwargs["cell2d"])


@requires_pkg("shapely")
@pytest.mark.parametrize(
"qx, qy, qz, nlay, nrow, ncol",
[
Expand Down

0 comments on commit 50666a5

Please sign in to comment.