TST: update is_closed test for shapely 1.8.2 (#2437)

This commit is contained in:
Joris Van den Bossche
2022-05-22 09:45:37 +02:00
committed by GitHub
parent 3abc6a79ca
commit 351ef71eb3
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -28,6 +28,7 @@ PANDAS_GE_14 = Version(pd.__version__) >= Version("1.4.0rc0")
SHAPELY_GE_18 = Version(shapely.__version__) >= Version("1.8")
SHAPELY_GE_182 = Version(shapely.__version__) >= Version("1.8.2")
SHAPELY_GE_20 = Version(shapely.__version__) >= Version("2.0")
GEOS_GE_390 = shapely.geos.geos_version >= (3, 9, 0)
+10
View File
@@ -467,8 +467,18 @@ def test_unary_predicates(attr):
# empty Linearring.is_ring gives False with Shapely < 2.0
if compat.USE_PYGEOS and not compat.SHAPELY_GE_20:
expected[-2] = True
elif (
attr == "is_closed"
and compat.USE_PYGEOS
and compat.SHAPELY_GE_182
and not compat.SHAPELY_GE_20
):
# In shapely 1.8.2, is_closed was changed to return always True for
# Polygon/MultiPolygon, while PyGEOS returns always False
expected = [False] * len(vals)
else:
expected = [getattr(t, attr) if t is not None else na_value for t in vals]
assert result.tolist() == expected