diff --git a/raster/r.in.gdal/testsuite/test_r_in_gdal.py b/raster/r.in.gdal/testsuite/test_r_in_gdal.py index aaf1f6a0ad2..355e9b74eda 100644 --- a/raster/r.in.gdal/testsuite/test_r_in_gdal.py +++ b/raster/r.in.gdal/testsuite/test_r_in_gdal.py @@ -5,7 +5,7 @@ import unittest -import osgeo +from subprocess import check_output from grass.gunittest.case import TestCase @@ -311,7 +311,15 @@ def test_netCDF_3d_5(self): self.assertLooksLike(map_list, text_from_file) @unittest.skipIf( - osgeo.gdal_version[0:2] < (3, 7), + tuple( + map( + int, + check_output(["gdal-config", "--version"]) + .decode("UTF8") + .split(".")[0:2], + ) + ) + < (3, 7), "GDAL version too old. Int8 support was introduced in GDAL 3.7", ) def test_int8_data(self):