diff --git a/autotest/gcore/hfa_srs.py b/autotest/gcore/hfa_srs.py index 2d256f850e11..49ba42295436 100755 --- a/autotest/gcore/hfa_srs.py +++ b/autotest/gcore/hfa_srs.py @@ -35,11 +35,9 @@ from osgeo import osr - ############################################################################### # Write a HFA/Imagine and read it back to check its SRS - -@pytest.mark.parametrize('epsg_code,epsg_broken', [ +epsg_list = [ [2758, False], # tmerc [2036, True], # sterea # failure caused by revert done in r22803 [2046, False], # tmerc @@ -59,7 +57,14 @@ [2056, False], # somerc [2027, False], # utm [4326, False], # longlat -]) +] + + +@pytest.mark.parametrize( + 'epsg_code,epsg_broken', + epsg_list, + ids=[str(r[0]) for r in epsg_list], +) def test_hfa_srs(epsg_code, epsg_broken): sr = osr.SpatialReference() sr.ImportFromEPSG(epsg_code) diff --git a/autotest/gcore/tiff_srs.py b/autotest/gcore/tiff_srs.py index 22aadb04e08a..b74f302bf6f9 100755 --- a/autotest/gcore/tiff_srs.py +++ b/autotest/gcore/tiff_srs.py @@ -35,8 +35,6 @@ from osgeo import osr - - ############################################################################### # Test fix for #4677: @@ -397,8 +395,7 @@ def _test_tiff_srs(sr, expect_fail): ############################################################################### # Write a geotiff and read it back to check its SRS -@pytest.mark.parametrize('use_epsg_code', [0, 1]) -@pytest.mark.parametrize('epsg_code,epsg_proj4_broken', [ +epsg_list = [ [2758, False], # tmerc [2036, False], # sterea [2046, False], # tmerc @@ -434,7 +431,15 @@ def _test_tiff_srs(sr, expect_fail): [31491, False], # Germany Zone projection [3857, True], # Web Mercator [102113, True], # ESRI WGS_1984_Web_Mercator -]) +] + + +@pytest.mark.parametrize('use_epsg_code', [0, 1]) +@pytest.mark.parametrize( + 'epsg_code,epsg_proj4_broken', + epsg_list, + ids=[str(r[0]) for r in epsg_list], +) def test_tiff_srs(use_epsg_code, epsg_code, epsg_proj4_broken): sr = osr.SpatialReference() sr.ImportFromEPSG(epsg_code) diff --git a/autotest/gdrivers/mrf.py b/autotest/gdrivers/mrf.py index 62891d34645f..2b3ed195394e 100755 --- a/autotest/gdrivers/mrf.py +++ b/autotest/gdrivers/mrf.py @@ -38,7 +38,7 @@ import gdaltest -@pytest.mark.parametrize('src_filename,chksum,chksum_after_reopening,options', [ +mrf_list = [ ('byte.tif', 4672, [4672], []), ('byte.tif', 4672, [4672], ['COMPRESS=DEFLATE']), ('byte.tif', 4672, [4672], ['COMPRESS=NONE']), @@ -73,7 +73,14 @@ ('rgbsmall.tif', 21212, [21261, 21209, 21254, 21215], ['INTERLEAVE=PIXEL', 'COMPRESS=JPEG', 'QUALITY=99', 'PHOTOMETRIC=RGB']), ('rgbsmall.tif', 21212, [21283, 21127, 21278, 21124], ['INTERLEAVE=PIXEL', 'COMPRESS=JPEG', 'QUALITY=99', 'PHOTOMETRIC=YCC']), ('12bit_rose_extract.jpg', 30075, [29650, 29680, 29680, 29650], ['COMPRESS=JPEG']), -]) +] + + +@pytest.mark.parametrize( + 'src_filename,chksum,chksum_after_reopening,options', + mrf_list, + ids=['{0}-{3}'.format(*r) for r in mrf_list], +) def test_mrf(src_filename, chksum, chksum_after_reopening, options): if src_filename == '12bit_rose_extract.jpg': import jpeg diff --git a/autotest/ogr/ogr_gml_geom.py b/autotest/ogr/ogr_gml_geom.py index 41bd789946d9..2fb7dd71e473 100755 --- a/autotest/ogr/ogr_gml_geom.py +++ b/autotest/ogr/ogr_gml_geom.py @@ -41,14 +41,14 @@ @pytest.mark.parametrize( - 'unit', + 'filename', [ - f[:-4] for f in os.listdir(os.path.join(os.path.dirname(__file__), 'data/wkb_wkt')) + f for f in os.listdir(os.path.join(os.path.dirname(__file__), 'data/wkb_wkt')) if f[-4:] == '.wkt' ] ) -def test_gml_geom(unit): - raw_wkt = open('data/wkb_wkt/' + unit + '.wkt').read() +def test_gml_geom(filename): + raw_wkt = open('data/wkb_wkt/' + filename).read() ###################################################################### # Convert WKT to GML. diff --git a/autotest/ogr/ogr_sqlite.py b/autotest/ogr/ogr_sqlite.py index 697a99e80d13..a51a29410d78 100755 --- a/autotest/ogr/ogr_sqlite.py +++ b/autotest/ogr/ogr_sqlite.py @@ -1520,7 +1520,8 @@ def test_ogr_spatialite_4(require_spatialite): @pytest.mark.parametrize( 'bUseComprGeom', - [False, True] + [False, True], + ids=['dont-compress-geometries', 'compress-geometries'] ) def test_ogr_spatialite_5(require_spatialite, bUseComprGeom): if bUseComprGeom and require_spatialite == '2.3.1': diff --git a/autotest/ogr/ogr_wfs.py b/autotest/ogr/ogr_wfs.py index 8e82b6da4977..2968d0c95bc8 100755 --- a/autotest/ogr/ogr_wfs.py +++ b/autotest/ogr/ogr_wfs.py @@ -70,7 +70,11 @@ def ogr_wfs_init(): pytest.skip('failed to open test file.') -@pytest.fixture(params=['NO', None], scope='module') +@pytest.fixture( + params=['NO', None], + scope='module', + ids=['without-streaming', 'with-streaming'] +) def with_and_without_streaming(request): with gdaltest.config_option('OGR_WFS_USE_STREAMING', request.param): yield diff --git a/autotest/ogr/ogr_wkbwkt_geom.py b/autotest/ogr/ogr_wkbwkt_geom.py index 9cc006cad32b..42adcaf04c8f 100755 --- a/autotest/ogr/ogr_wkbwkt_geom.py +++ b/autotest/ogr/ogr_wkbwkt_geom.py @@ -39,15 +39,15 @@ @pytest.mark.parametrize( - 'unit', + 'filename', [ - f[:-4] for f in os.listdir(os.path.join(os.path.dirname(__file__), 'data/wkb_wkt')) + f for f in os.listdir(os.path.join(os.path.dirname(__file__), 'data/wkb_wkt')) if f[-4:] == '.wkb' ] ) -def test_wkbwkt_geom(unit): - raw_wkb = open('data/wkb_wkt/' + unit + '.wkb', 'rb').read() - raw_wkt = open('data/wkb_wkt/' + unit + '.wkt').read() +def test_wkbwkt_geom(filename): + raw_wkb = open('data/wkb_wkt/' + filename, 'rb').read() + raw_wkt = open('data/wkb_wkt/' + os.path.splitext(filename)[0] + '.wkt').read() ###################################################################### # Compare the WKT derived from the WKB file to the WKT provided diff --git a/autotest/ogr/ogr_wktempty.py b/autotest/ogr/ogr_wktempty.py index f8bf223249f0..678f5362a3d5 100755 --- a/autotest/ogr/ogr_wktempty.py +++ b/autotest/ogr/ogr_wktempty.py @@ -31,8 +31,7 @@ from osgeo import ogr - -@pytest.mark.parametrize("test_input,expected", [ +wkt_list = [ ('GEOMETRYCOLLECTION(EMPTY)', 'GEOMETRYCOLLECTION EMPTY'), ('MULTIPOLYGON( EMPTY )', 'MULTIPOLYGON EMPTY'), ('MULTILINESTRING(EMPTY)', 'MULTILINESTRING EMPTY'), @@ -48,7 +47,14 @@ ('POINT EMPTY', 'POINT EMPTY'), ('LINESTRING EMPTY', 'LINESTRING EMPTY'), ('POLYGON EMPTY', 'POLYGON EMPTY') -]) +] + + +@pytest.mark.parametrize( + "test_input,expected", + wkt_list, + ids=[r[0] for r in wkt_list] +) def test_empty_wkt(test_input, expected): geom = ogr.CreateGeometryFromWkt(test_input) wkt = geom.ExportToWkt()