Skip to content

Commit 37818f5

Browse files
iudeenKludex
andauthored
✅ Fix test error in Windows for jsonable_encoder (fastapi#9840)
Co-authored-by: Marcelo Trylesinski <[email protected]>
1 parent 2d8a776 commit 37818f5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/test_jsonable_encoder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ class ModelWithPath(BaseModel):
247247
class Config:
248248
arbitrary_types_allowed = True
249249

250-
obj = ModelWithPath(path=PurePath("/foo", "bar"))
251-
assert jsonable_encoder(obj) == {"path": "/foo/bar"}
250+
test_path = PurePath("/foo", "bar")
251+
obj = ModelWithPath(path=test_path)
252+
assert jsonable_encoder(obj) == {"path": str(test_path)}
252253

253254

254255
def test_encode_model_with_pure_posix_path():

0 commit comments

Comments
 (0)