diff --git a/tests/test_jsonable_encoder.py b/tests/test_jsonable_encoder.py index 17e3ef043..81bf94ece 100644 --- a/tests/test_jsonable_encoder.py +++ b/tests/test_jsonable_encoder.py @@ -281,6 +281,12 @@ def test_encode_model_with_pure_windows_path(): assert jsonable_encoder(obj) == {"path": "\\foo\\bar"} +def test_encode_pure_path(): + test_path = PurePath("/foo", "bar") + + assert jsonable_encoder({"path": test_path}) == {"path": str(test_path)} + + @needs_pydanticv1 def test_encode_root(): from pydantic import v1