From bcf56a53837ce0883c5622851419a51e04e78d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 20 Dec 2025 16:31:28 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Add=20test=20for=20coverage=20for?= =?UTF-8?q?=20jsonable=5Fencoder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_jsonable_encoder.py | 6 ++++++ 1 file changed, 6 insertions(+) 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