]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
✅ Fix test error in Windows for `jsonable_encoder` (#9840)
authorIrfanuddin Shafi Ahmed <irfanudeen08@gmail.com>
Wed, 2 Aug 2023 15:28:34 +0000 (20:58 +0530)
committerGitHub <noreply@github.com>
Wed, 2 Aug 2023 15:28:34 +0000 (17:28 +0200)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
tests/test_jsonable_encoder.py

index ff3033ecdf427d6749ab8fe1dd13c500b8ca4c62..7c8338ff376d04f701c50031827d90330f4f8729 100644 (file)
@@ -247,8 +247,9 @@ def test_encode_model_with_pure_path():
             class Config:
                 arbitrary_types_allowed = True
 
-    obj = ModelWithPath(path=PurePath("/foo", "bar"))
-    assert jsonable_encoder(obj) == {"path": "/foo/bar"}
+    test_path = PurePath("/foo", "bar")
+    obj = ModelWithPath(path=test_path)
+    assert jsonable_encoder(obj) == {"path": str(test_path)}
 
 
 def test_encode_model_with_pure_posix_path():