27
27
prepare_testfile ,
28
28
requires_pyarrow_api ,
29
29
requires_arrow_api ,
30
+ requires_shapely ,
30
31
)
31
32
32
33
try :
@@ -117,9 +118,7 @@ def test_read_no_geometry(naturalearth_lowres):
117
118
assert geometry is None
118
119
119
120
120
- @pytest .mark .skipif (
121
- not HAS_SHAPELY , reason = "Shapely is required for mask functionality"
122
- )
121
+ @requires_shapely
123
122
def test_read_no_geometry__mask (naturalearth_lowres ):
124
123
geometry , fields = read (
125
124
naturalearth_lowres ,
@@ -281,9 +280,7 @@ def test_read_bbox_where(naturalearth_lowres_all_ext):
281
280
assert np .array_equal (fields [3 ], ["CAN" ])
282
281
283
282
284
- @pytest .mark .skipif (
285
- not HAS_SHAPELY , reason = "Shapely is required for mask functionality"
286
- )
283
+ @requires_shapely
287
284
@pytest .mark .parametrize (
288
285
"mask" ,
289
286
[
@@ -297,17 +294,13 @@ def test_read_mask_invalid(naturalearth_lowres, mask):
297
294
read (naturalearth_lowres , mask = mask )
298
295
299
296
300
- @pytest .mark .skipif (
301
- not HAS_SHAPELY , reason = "Shapely is required for mask functionality"
302
- )
297
+ @requires_shapely
303
298
def test_read_bbox_mask_invalid (naturalearth_lowres ):
304
299
with pytest .raises (ValueError , match = "cannot set both 'bbox' and 'mask'" ):
305
300
read (naturalearth_lowres , bbox = (- 85 , 8 , - 80 , 10 ), mask = shapely .Point (- 105 , 55 ))
306
301
307
302
308
- @pytest .mark .skipif (
309
- not HAS_SHAPELY , reason = "Shapely is required for mask functionality"
310
- )
303
+ @requires_shapely
311
304
@pytest .mark .parametrize (
312
305
"mask,expected" ,
313
306
[
@@ -342,9 +335,7 @@ def test_read_mask(naturalearth_lowres_all_ext, mask, expected):
342
335
assert len (geometry ) == len (expected )
343
336
344
337
345
- @pytest .mark .skipif (
346
- not HAS_SHAPELY , reason = "Shapely is required for mask functionality"
347
- )
338
+ @requires_shapely
348
339
def test_read_mask_sql (naturalearth_lowres_all_ext ):
349
340
fields = read (
350
341
naturalearth_lowres_all_ext ,
@@ -355,9 +346,7 @@ def test_read_mask_sql(naturalearth_lowres_all_ext):
355
346
assert np .array_equal (fields [3 ], ["CAN" ])
356
347
357
348
358
- @pytest .mark .skipif (
359
- not HAS_SHAPELY , reason = "Shapely is required for mask functionality"
360
- )
349
+ @requires_shapely
361
350
def test_read_mask_where (naturalearth_lowres_all_ext ):
362
351
fields = read (
363
352
naturalearth_lowres_all_ext ,
0 commit comments