Skip to content

Commit

Permalink
Add test suggested in conda-forge#182 (comment)
Browse files Browse the repository at this point in the history
Co-authored-by: Xylar Asay-Davis <[email protected]>
Co-authored-by: Filipe <[email protected]>
  • Loading branch information
3 people committed Jul 21, 2023
1 parent fb8f36b commit 553e86e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "4.9.2" %}
{% set build = 9 %}
{% set build = 10 %}

# recipe-lint fails if mpi is undefined
{% set mpi = mpi or 'nompi' %}
Expand Down Expand Up @@ -87,7 +87,12 @@ requirements:
- aws-sdk-cpp

test:
files:
- test_netcdf.py
requires:
- netcdf4
commands:
- python -c "import test_netcdf; test_netcdf.test_netcdf()"
- test ! -f ${PREFIX}/lib/libnetcdf.a # [not win]
- test -f ${PREFIX}/lib/libnetcdf${SHLIB_EXT} # [not win]
- nc-config --all # [not win]
Expand Down
1 change: 1 addition & 0 deletions recipe/run_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%PYTHON% -c "import test_netcdf; test_netcdf.test_netcdf()"
6 changes: 6 additions & 0 deletions recipe/test_netcdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from netCDF4 import Dataset


def test_netcdf():
nc = Dataset("test_netcdf4_python.nc", mode="w")
nc.close()

0 comments on commit 553e86e

Please sign in to comment.