diff options
| author | Claude Paroz <claude@2xlibre.net> | 2015-06-26 14:57:41 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-06-26 14:57:45 +0200 |
| commit | 0cc39e50e136780fcdb5931502980655fff2d488 (patch) | |
| tree | 19c3a8938b5ed8e017aa4cf5ec3e2f30a8e4b2e7 | |
| parent | b647ccfa673890d4ee30a29bb759a19e4f1a67dc (diff) | |
Pushed GDAL skip condition inside test
As GDAL_VERSION is conditionnaly imported, it cannot be referenced
in skipIf decorator.
| -rw-r--r-- | tests/gis_tests/gdal_tests/test_raster.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/gis_tests/gdal_tests/test_raster.py b/tests/gis_tests/gdal_tests/test_raster.py index a307c0b1e6..aabec068ac 100644 --- a/tests/gis_tests/gdal_tests/test_raster.py +++ b/tests/gis_tests/gdal_tests/test_raster.py @@ -54,7 +54,7 @@ from django.utils._os import upath from ..data.rasters.textrasters import JSON_RASTER if HAS_GDAL: - from django.contrib.gis.gdal import GDALRaster + from django.contrib.gis.gdal import GDALRaster, GDAL_VERSION from django.contrib.gis.gdal.raster.band import GDALBand @@ -211,8 +211,9 @@ class GDALRasterTests(unittest.TestCase): 12.0, 13.0, 14.0, 15.0] ) - @unittest.skipIf(GDAL_VERSION < (1, 8, 1), "GDAL >= 1.8.1 is required for this test") def test_raster_transform(self): + if GDAL_VERSION < (1, 8, 1): + self.skipTest("GDAL >= 1.8.1 is required for this test") # Prepare tempfile and nodata value rstfile = tempfile.NamedTemporaryFile(suffix='.tif') ndv = 99 |
