Skip to content

Commit 02c1f7c

Browse files
committed
Add parametrization for test_schema_consistency
1 parent bbfdef0 commit 02c1f7c

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

tests/test_geometries.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,23 @@ def test_parse_geometry_obj_point():
339339
)
340340

341341

342-
def test_schema():
342+
@pytest.mark.parametrize(
343+
"geojson_pydantic_model",
344+
(
345+
GeometryCollection,
346+
LineString,
347+
MultiLineString,
348+
MultiPoint,
349+
MultiPolygon,
350+
Point,
351+
Polygon,
352+
),
353+
)
354+
def test_schema_consistency(geojson_pydantic_model):
343355
"""Test to check that the schema is the same for validation and serialization"""
344-
assert Point.model_json_schema(mode="validation") == Point.model_json_schema(
345-
mode="serialization"
346-
)
356+
assert geojson_pydantic_model.model_json_schema(
357+
mode="validation"
358+
) == geojson_pydantic_model.model_json_schema(mode="serialization")
347359

348360

349361
def test_parse_geometry_obj_multi_point():

0 commit comments

Comments
 (0)