mirror of
https://github.com/rasterio/rasterio.git
synced 2025-12-08 17:36:12 +00:00
Only run NetCDF tests if NetCDF driver is installed.
This commit is contained in:
parent
896d3370f4
commit
2069c1e97f
@ -11,6 +11,10 @@ from rasterio.rio.edit_info import (
|
||||
from rasterio.rio.main import main_group
|
||||
|
||||
|
||||
with rasterio.Env() as env:
|
||||
HAVE_NETCDF = 'NetCDF' in env.drivers().keys()
|
||||
|
||||
|
||||
def test_delete_nodata_exclusive_opts(data):
|
||||
"""--unset-nodata and --nodata can't be used together"""
|
||||
runner = CliRunner()
|
||||
@ -781,6 +785,8 @@ def test_info_checksums_only():
|
||||
|
||||
@pytest.mark.skipif(parse(rasterio.__gdal_version__) < parse('2.1'),
|
||||
reason='netCDF requires GDAL 2.1+')
|
||||
@pytest.mark.skipif(not HAVE_NETCDF,
|
||||
reason="GDAL not compiled with NetCDF driver.")
|
||||
def test_info_subdatasets():
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(
|
||||
|
||||
@ -4,8 +4,14 @@ import pytest
|
||||
import rasterio
|
||||
|
||||
|
||||
with rasterio.Env() as env:
|
||||
HAVE_NETCDF = 'NetCDF' in env.drivers().keys()
|
||||
|
||||
|
||||
@pytest.mark.skipif(parse(rasterio.__gdal_version__) < parse('2.1'),
|
||||
reason="netcdf driver not available before GDAL 2.1")
|
||||
@pytest.mark.skipif(not HAVE_NETCDF,
|
||||
reason="GDAL not compiled with NetCDF driver.")
|
||||
def test_subdatasets():
|
||||
"""Get subdataset names and descriptions"""
|
||||
with rasterio.open('netcdf:tests/data/RGB.nc') as src:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user