Skip to content

Commit

Permalink
Enable windows local tests (#278)
Browse files Browse the repository at this point in the history
* tests: enable local tests on windows

* upath: fix local_tests on windows (expose local_file attribute)
  • Loading branch information
ap-- committed Sep 8, 2024
1 parent 0f40d6c commit b03e845
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dev/fsspec_inspector/generate_flavours.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ def generate_class_source_code(
s.append(f" {attr} = {value!r}")
for attr in attributes:
s.append(f" {attr} = {getattr(cls, attr)!r}")
if getattr(cls, "local_file", False):
s.append(" local_file = True")
s.append("")
for method in methods:
s.append(inspect.getsource(getattr(cls, method)))
Expand Down
2 changes: 2 additions & 0 deletions upath/_flavour_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class AsyncLocalFileSystemFlavour(AbstractFileSystemFlavour):
protocol = ()
root_marker = '/'
sep = '/'
local_file = True

@classmethod
def _strip_protocol(cls, path):
Expand Down Expand Up @@ -622,6 +623,7 @@ class LocalFileSystemFlavour(AbstractFileSystemFlavour):
protocol = ('file', 'local')
root_marker = '/'
sep = '/'
local_file = True

@classmethod
def _strip_protocol(cls, path):
Expand Down
3 changes: 0 additions & 3 deletions upath/tests/implementations/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
from upath import UPath
from upath.implementations.local import LocalPath
from upath.tests.cases import BaseTests
from upath.tests.utils import skip_on_windows
from upath.tests.utils import xfail_if_version


@skip_on_windows
class TestFSSpecLocal(BaseTests):
@pytest.fixture(autouse=True)
def path(self, local_testdir):
Expand All @@ -18,7 +16,6 @@ def test_is_LocalPath(self):
assert isinstance(self.path, LocalPath)


@skip_on_windows
@xfail_if_version("fsspec", lt="2023.10.0", reason="requires fsspec>=2023.10.0")
class TestRayIOFSSpecLocal(BaseTests):
@pytest.fixture(autouse=True)
Expand Down

0 comments on commit b03e845

Please sign in to comment.