From 3a7991b63f44c3eb923aa8a65d83d7a993b560b5 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Sun, 22 Sep 2024 19:39:32 -0600 Subject: [PATCH] Skip test if GDAL < 3.6 --- tests/test_model.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/test_model.py b/tests/test_model.py index 1009a0bf..6267f9ca 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -256,7 +256,7 @@ def test_feature_encode(): assert o_dict["id"] == "foo" assert o_dict["geometry"]["type"] == "Point" assert o_dict["geometry"]["coordinates"] == (0, 0) - assert o_dict["properties"]["bytes"] == b'3031323334' + assert o_dict["properties"]["bytes"] == b"3031323334" def test_decode_object_hook(): @@ -313,7 +313,7 @@ def test_feature_gi(): def test_encode_bytes(): """Bytes are encoded using base64.""" - assert ObjectEncoder().default(b"01234") == b'3031323334' + assert ObjectEncoder().default(b"01234") == b"3031323334" def test_null_property_encoding(): @@ -342,7 +342,10 @@ def test_feature_repr(): geometry=Geometry(type="LineString", coordinates=[(0, 0)] * 100), properties=Properties(a=1, foo="bar"), ) - assert repr(feat) == "fiona.Feature(geometry=fiona.Geometry(coordinates=[(0, 0), ...], type='LineString'), id='1', properties=fiona.Properties(a=1, foo='bar'))" + assert ( + repr(feat) + == "fiona.Feature(geometry=fiona.Geometry(coordinates=[(0, 0), ...], type='LineString'), id='1', properties=fiona.Properties(a=1, foo='bar'))" + ) def test_issue1430(): @@ -354,6 +357,9 @@ def test_issue1430(): assert feat.properties["foo"] == "bar" +@pytest.mark.skipif( + not gdal_version.at_least("3.6"), reason="Requires at least GDAL 3.6" +) def test_issue1451(): """Report when a JSON property can't be decoded.""" with fiona.open("tests/data/issue1451.geojson") as collection: @@ -363,4 +369,6 @@ def test_issue1451(): first, second = list(collection) assert first.properties["country_code"].startswith("String(JSON)") assert "val=b'0583'" in first.properties["country_code"] - assert "Extra data: line 1 column 2 (char 1)" in first.properties["country_code"] + assert ( + "Extra data: line 1 column 2 (char 1)" in first.properties["country_code"] + )