diff --git a/tests/gis_tests/gdal_tests/test_raster.py b/tests/gis_tests/gdal_tests/test_raster.py index 834e3f6048..8a0aa09b00 100644 --- a/tests/gis_tests/gdal_tests/test_raster.py +++ b/tests/gis_tests/gdal_tests/test_raster.py @@ -320,12 +320,13 @@ class GDALBandTests(SimpleTestCase): self.assertEqual(self.band.datatype(), 1) self.assertEqual(self.band.datatype(as_string=True), 'GDT_Byte') self.assertEqual(self.band.nodata_value, 15) - data = self.band.data() - assert_array = numpy.loadtxt( - os.path.join(os.path.dirname(upath(__file__)), '../data/rasters/raster.numpy.txt') - ) - numpy.testing.assert_equal(data, assert_array) - self.assertEqual(data.shape, (self.band.height, self.band.width)) + if numpy: + data = self.band.data() + assert_array = numpy.loadtxt( + os.path.join(os.path.dirname(upath(__file__)), '../data/rasters/raster.numpy.txt') + ) + numpy.testing.assert_equal(data, assert_array) + self.assertEqual(data.shape, (self.band.height, self.band.width)) try: smin, smax, smean, sstd = self.band.statistics(approximate=True) self.assertEqual(smin, 0)