Skip to content
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

Fix CI mock filesystem fixtures #5740

Merged
merged 8 commits into from
Apr 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use del instead of clear
albertvillanova committed Apr 13, 2023
commit 3dafe55c66307030acd3d9fc3cec3c71080a7887
6 changes: 2 additions & 4 deletions tests/fixtures/fsspec.py
Original file line number Diff line number Diff line change
@@ -7,8 +7,6 @@
from fsspec.implementations.local import AbstractFileSystem, LocalFileSystem, stringify_path
from fsspec.registry import _registry as _fsspec_registry

from datasets.filesystems import _register_custom_filesystems


class MockFileSystem(AbstractFileSystem):
protocol = "mock"
@@ -98,8 +96,8 @@ def mock_fsspec():
fsspec.register_implementation("mock", MockFileSystem)
fsspec.register_implementation("tmp", TmpDirFileSystem)
yield
_fsspec_registry.clear()
_register_custom_filesystems()
del _fsspec_registry["mock"]
del _fsspec_registry["tmp"]


@pytest.fixture
5 changes: 2 additions & 3 deletions tests/test_streaming_download_manager.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
xsplitext,
xwalk,
)
from datasets.filesystems import COMPRESSION_FILESYSTEMS, _register_custom_filesystems
from datasets.filesystems import COMPRESSION_FILESYSTEMS
from datasets.utils.hub import hf_hub_url

from .utils import require_lz4, require_zstandard, slow
@@ -133,8 +133,7 @@ def _open(
def mock_fsspec():
fsspec.register_implementation("mock", DummyTestFS)
yield
_fsspec_registry.clear()
_register_custom_filesystems()
del _fsspec_registry["mock"]


def _readd_double_slash_removed_by_path(path_as_posix: str) -> str: