diff --git a/fsspec/implementations/tests/memory/memory_test.py b/fsspec/implementations/tests/memory/memory_test.py index 98bf063ef..fd0ebaac8 100644 --- a/fsspec/implementations/tests/memory/memory_test.py +++ b/fsspec/implementations/tests/memory/memory_test.py @@ -1,5 +1,3 @@ -import pytest - import fsspec.tests.abstract as abstract from fsspec.implementations.tests.memory.memory_fixtures import MemoryFixtures @@ -9,21 +7,7 @@ class TestMemoryCopy(abstract.AbstractCopyTests, MemoryFixtures): class TestMemoryGet(abstract.AbstractGetTests, MemoryFixtures): - @pytest.mark.skip(reason="Bug: does not auto-create new directory") - def test_get_file_to_new_directory(self): - pass - - @pytest.mark.skip(reason="Bug: does not auto-create new directory") - def test_get_file_to_file_in_new_directory(self): - pass - - @pytest.mark.skip(reason="Bug: does not auto-create new directory") - def test_get_glob_to_new_directory(self): - pass - - @pytest.mark.skip(reason="Bug: does not auto-create new directory") - def test_get_list_of_files_to_new_directory(self): - pass + pass class TestMemoryPut(abstract.AbstractPutTests, MemoryFixtures): diff --git a/fsspec/spec.py b/fsspec/spec.py index 8b051b94b..2bdfa3854 100644 --- a/fsspec/spec.py +++ b/fsspec/spec.py @@ -861,12 +861,16 @@ def get_file( self, rpath, lpath, callback=_DEFAULT_CALLBACK, outfile=None, **kwargs ): """Copy single remote file to local""" + from .implementations.local import LocalFileSystem + if isfilelike(lpath): outfile = lpath elif self.isdir(rpath): os.makedirs(lpath, exist_ok=True) return None + LocalFileSystem(auto_mkdir=True).makedirs(self._parent(lpath), exist_ok=True) + with self.open(rpath, "rb", **kwargs) as f1: if outfile is None: outfile = open(lpath, "wb")