Fix test error in Windows for `jsonable_encoder` (#9840)

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
This commit is contained in:
Irfanuddin Shafi Ahmed 2023-08-02 20:58:34 +05:30 committed by GitHub
parent 2d8a776836
commit 37818f553d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View 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():