Skip to content

Commit 430ddfc

Browse files
committed
Merge pull request #233 from micahcochran/patch-demo-run_all.py
makes netCDF4 optional for examples/run_all.py
2 parents 24336eb + 8dcac67 commit 430ddfc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/run_all.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
test_files.remove('plothighsandlows.py') # requires scipy
1313
test_files.remove('lic_demo.py')
1414
test_files.remove('testwmsimage.py')
15+
try:
16+
from netCDF4 import Dataset
17+
except ImportError:
18+
# remove tests requiring netCDF4
19+
sys.stdout.write("Could not import netCDF4, skipping tests that require netCDF4.\n")
20+
test_files.remove('streamplot_demo.py')
21+
test_files.remove('plotprecip.py')
22+
test_files.remove('test_rotpole.py')
23+
test_files.remove('ccsm_popgrid.py')
24+
test_files.remove('ploticos.py')
25+
1526
py_path = os.environ.get('PYTHONPATH')
1627
if py_path is None:
1728
py_path = '.'

0 commit comments

Comments
 (0)