diff --git a/examples/conftest.py b/examples/conftest.py new file mode 100644 index 00000000..e3eabc51 --- /dev/null +++ b/examples/conftest.py @@ -0,0 +1,11 @@ + +# depend on optional iris, xesmf, etc +collect_ignore_glob = [ + "Homepage.ipynb", + "user_guide/Resampling_Grids.ipynb", + "user_guide/Gridded_Datasets_*.ipynb", + "gallery/bokeh/xarray_gridded.ipynb", + "gallery/*/xarray_image.ipynb", + "gallery/*/xarray_quadmesh.ipynb", + "gallery/*/katrina_track.ipynb", +] diff --git a/pyproject.toml b/pyproject.toml index 41487451..75c55594 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,3 +61,24 @@ unfixable = [ ignore-words-list = "lod,nd" skip = "doc/generate_modules.py,*.json,*.csv" write-changes = true + +[tool.pytest.ini_options] +addopts = "-v --pyargs --doctest-ignore-import-errors --strict-markers --strict-config --color=yes" +norecursedirs = "doc .git dist build _build .ipynb_checkpoints" +minversion = 7 +xfail_strict = true +log_cli_level = "INFO" +filterwarnings = [ + "error::holoviews.HoloviewsUserWarning", + "error::geoviews.GeoviewsDeprecationWarning", + "error::geoviews.GeoviewsUserWarning", + # 2023-01: https://github.com/bokeh/bokeh/pull/12690 + "ignore:`.+?` is a deprecated alias for `.+?`.:DeprecationWarning:bokeh", + # 2023-01: https://github.com/cupy/cupy/pull/7245 + "ignore:`.+?` is a deprecated alias for `.+?`.:DeprecationWarning:cupy", + # 2023-01: https://github.com/SciTools/cartopy/issues/2113 + "ignore:The 'geom_factory' function is deprecated in Shapely 2:DeprecationWarning:cartopy.crs", + "error::holoviews.HoloviewsDeprecationWarning", + # 2023-09: See https://github.com/Unidata/MetPy/pull/3117 + "ignore:'xdrlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:metpy.io.nexrad", +] diff --git a/setup.py b/setup.py index d92023bd..08f30e6d 100644 --- a/setup.py +++ b/setup.py @@ -152,7 +152,7 @@ def run(self): 'pooch', ], 'tests': [ - 'nbsmoke >=0.2.0', + 'nbval', 'pytest', 'fiona', 'rioxarray', diff --git a/tox.ini b/tox.ini index bb50caa6..c1951952 100644 --- a/tox.ini +++ b/tox.ini @@ -19,12 +19,12 @@ commands = pytest geoviews --cov=./geoviews [_examples] description = Test that default examples run deps = .[recommended, tests] -commands = pytest --nbsmoke-run -k ".ipynb" +commands = pytest --nbval-lax examples [_examples_extra] description = Test that all examples run deps = .[examples_extra, tests] -commands = pytest --nbsmoke-run -k ".ipynb" --ignore-nbsmoke-skip-run +commands = pytest --nbval-lax examples [_all_recommended] description = Run all recommended tests @@ -53,31 +53,3 @@ deps = unit: {[_unit]deps} examples: {[_examples]deps} examples_extra: {[_examples_extra]deps} all_recommended: {[_all_recommended]deps} - -[pytest] -addopts = -v --pyargs --doctest-ignore-import-errors --strict-markers --color=yes -norecursedirs = doc .git dist build _build .ipynb_checkpoints -minversion = 7 -xfail_strict = true -log_cli_level = INFO -# depend on optional iris, xesmf, etc -nbsmoke_skip_run = .*Homepage\.ipynb$ - .*user_guide/Resampling_Grids\.ipynb$ - .*user_guide/Gridded_Datasets_.*\.ipynb$ - .*gallery/bokeh/xarray_gridded\.ipynb$ - .*gallery/.*/xarray_image\.ipynb$ - .*gallery/.*/xarray_quadmesh\.ipynb$ - .*gallery/.*/katrina_track\.ipynb$ -filterwarnings = - ; 2023-01: https://github.com/bokeh/bokeh/pull/12690 - ignore:`.+?` is a deprecated alias for `.+?`.:DeprecationWarning:bokeh - ; 2023-01: https://github.com/cupy/cupy/pull/7245 - ignore:`.+?` is a deprecated alias for `.+?`.:DeprecationWarning:cupy - ; 2023-01: https://github.com/SciTools/cartopy/issues/2113 - ignore:The 'geom_factory' function is deprecated in Shapely 2:DeprecationWarning:cartopy.crs - error::holoviews.HoloviewsDeprecationWarning - error::holoviews.HoloviewsUserWarning - error::geoviews.GeoviewsDeprecationWarning - error::geoviews.GeoviewsUserWarning - ; 2023-09: See https://github.com/Unidata/MetPy/pull/3117 - ignore:'xdrlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:metpy.io.nexrad