-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC of base tests for fsspec behavior. #651
base: master
Are you sure you want to change the base?
Conversation
This starts a suite of base tests to verify that downstream libraries correctly implement the spec. xref fsspec#650
Interestingly, fsspec/tests/spec/test_memory.py::TestRead::test_ls_raises_filenotfound FAILED [100%]
=========================================================================== FAILURES ===========================================================================
_____________________________________________________________ TestRead.test_ls_raises_filenotfound _____________________________________________________________
self = <test_memory.TestRead object at 0x7f3a3edfb760>, fs = <fsspec.implementations.memory.MemoryFileSystem object at 0x7f3a3ee0d340>, prefix = '/root/'
def test_ls_raises_filenotfound(self, fs, prefix):
with pytest.raises(FileNotFoundError):
> fs.ls(f"{prefix}/not-a-key")
E Failed: DID NOT RAISE <class 'FileNotFoundError'>
fsspec/tests/base/spec.py:25: Failed
=================================================================== short test summary info ====================================================================
FAILED fsspec/tests/spec/test_memory.py::TestRead::test_ls_raises_filenotfound - Failed: DID NOT RAISE <class 'FileNotFoundError'> Is this deliberate? In [1]: import fsspec
In [2]: fs = fsspec.get_filesystem_class("memory")()
In [3]: fs.ls("/a")
Out[3]: [] |
Yep, MemoryFileSystem should probably raise. It has "pseudo directories" explicitly holding references that don't contain anything (i.e., empty directories), so we should be able to tell the difference between non-existent and empty directory. |
|
OK, I've xfailed that MemoryFileSystem test for now: #652. Some general thoughts / questions:
cc @isidentical from #650 if you have thoughts on the implementation. It is a bit awkward to have this |
xref #650