Skip to content

Commit

Permalink
test: adjust fspath test for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Mar 3, 2024
1 parent b6fa0c0 commit 9fed00b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions upath/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9fed00b

Please sign in to comment.