Skip to content

Commit

Permalink
don't expect an exception on gdal < 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emlys committed May 20, 2024
1 parent 7c3597b commit bc82f5d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/test_geoprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2789,13 +2789,8 @@ def test_create_raster_from_vector_extents_invalid_pixeltype(self):
self.workspace_dir, 'target_raster.tif')
target_nodata = -1
target_pixel_type = gdal.GDT_Int16
if packaging.version.parse(gdal.__version__) < packaging.version.parse('3.3.0'):
# older versions of GDAL raise a generic exception that's much less helpful
with self.assertRaises(Exception):
pygeoprocessing.create_raster_from_vector_extents(
source_vector_path, target_raster_path, _DEFAULT_PIXEL_SIZE,
target_nodata, target_pixel_type)
else:
# older versions of GDAL don't properly raise this exception
if packaging.version.parse(gdal.__version__) >= packaging.version.parse('3.3.0'):
with self.assertRaises(ValueError) as cm:
pygeoprocessing.create_raster_from_vector_extents(
source_vector_path, target_raster_path, _DEFAULT_PIXEL_SIZE,
Expand Down

0 comments on commit bc82f5d

Please sign in to comment.