Skip to content

Commit

Permalink
Update pytest to align with HoloViews (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Nov 21, 2023
1 parent 0201068 commit e9b8962
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 31 deletions.
11 changes: 11 additions & 0 deletions examples/conftest.py
Original file line number Diff line number Diff line change
@@ -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",
]
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def run(self):
'pooch',
],
'tests': [
'nbsmoke >=0.2.0',
'nbval',
'pytest',
'fiona',
'rioxarray',
Expand Down
32 changes: 2 additions & 30 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit e9b8962

Please sign in to comment.