Skip to content

Commit

Permalink
tests: dvcfs: use fspath while testing (#9872)
Browse files Browse the repository at this point in the history
get_file does not support PathLike objects. fsspec does not support them in get_file.

See fsspec/filesystem_spec#896.
Fixes test failures in dvc-webhdfs and dvc-hdfs.
  • Loading branch information
skshetry authored Aug 23, 2023
1 parent 8e353f9 commit 8cb7e49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dvc/testing/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def test_filesystem(
assert fobj.read() == b"script1"

tmp = make_tmp_dir("temp-download")
fs.get_file("data/foo", tmp / "foo")
fs.get_file("data/foo", (tmp / "foo").fs_path)
assert (tmp / "foo").read_text() == "foo"

fs.get_file("scripts/script1", tmp / "script1")
fs.get_file("scripts/script1", (tmp / "script1").fs_path)
assert (tmp / "script1").read_text() == "script1"

fs.get("/", (tmp / "all").fs_path, recursive=True)
Expand Down

0 comments on commit 8cb7e49

Please sign in to comment.