From 9fed00b8004861b653357d22adfa2ca2bcb62bd7 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 3 Mar 2024 22:38:22 +0100 Subject: [PATCH] test: adjust fspath test for windows --- upath/tests/test_core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/upath/tests/test_core.py b/upath/tests/test_core.py index 1e2be31..2bfeb8d 100644 --- a/upath/tests/test_core.py +++ b/upath/tests/test_core.py @@ -255,15 +255,17 @@ def test_compare_to_pathlib_path_ne(): assert pathlib.Path("/bucket/folder") == UPath("/bucket/folder") -def test_handle_fspath_args(): +def test_handle_fspath_args(tmp_path): + f = os.fspath(tmp_path.joinpath("file.txt")) + class X: def __str__(self): raise ValueError("should not be called") def __fspath__(self): - return "/some/path" + return f - assert UPath(X()).path == "/some/path" + assert UPath(X()).path == f @pytest.mark.parametrize(