Skip to content

Commit b03e845

Browse files
authored
Enable windows local tests (#278)
* tests: enable local tests on windows * upath: fix local_tests on windows (expose local_file attribute)
1 parent 0f40d6c commit b03e845

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

dev/fsspec_inspector/generate_flavours.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ def generate_class_source_code(
336336
s.append(f" {attr} = {value!r}")
337337
for attr in attributes:
338338
s.append(f" {attr} = {getattr(cls, attr)!r}")
339+
if getattr(cls, "local_file", False):
340+
s.append(" local_file = True")
339341
s.append("")
340342
for method in methods:
341343
s.append(inspect.getsource(getattr(cls, method)))

upath/_flavour_sources.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class AsyncLocalFileSystemFlavour(AbstractFileSystemFlavour):
140140
protocol = ()
141141
root_marker = '/'
142142
sep = '/'
143+
local_file = True
143144

144145
@classmethod
145146
def _strip_protocol(cls, path):
@@ -622,6 +623,7 @@ class LocalFileSystemFlavour(AbstractFileSystemFlavour):
622623
protocol = ('file', 'local')
623624
root_marker = '/'
624625
sep = '/'
626+
local_file = True
625627

626628
@classmethod
627629
def _strip_protocol(cls, path):

upath/tests/implementations/test_local.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
from upath import UPath
44
from upath.implementations.local import LocalPath
55
from upath.tests.cases import BaseTests
6-
from upath.tests.utils import skip_on_windows
76
from upath.tests.utils import xfail_if_version
87

98

10-
@skip_on_windows
119
class TestFSSpecLocal(BaseTests):
1210
@pytest.fixture(autouse=True)
1311
def path(self, local_testdir):
@@ -18,7 +16,6 @@ def test_is_LocalPath(self):
1816
assert isinstance(self.path, LocalPath)
1917

2018

21-
@skip_on_windows
2219
@xfail_if_version("fsspec", lt="2023.10.0", reason="requires fsspec>=2023.10.0")
2320
class TestRayIOFSSpecLocal(BaseTests):
2421
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)