()
| 31 | |
| 32 | @pytest.fixture |
| 33 | def fsspectest(): |
| 34 | pytest.importorskip("fsspec") |
| 35 | from fsspec import register_implementation |
| 36 | from fsspec.implementations.memory import MemoryFileSystem |
| 37 | from fsspec.registry import _registry as registry |
| 38 | |
| 39 | class TestMemoryFS(MemoryFileSystem): |
| 40 | protocol = "testmem" |
| 41 | test = [None] |
| 42 | |
| 43 | def __init__(self, **kwargs) -> None: |
| 44 | self.test[0] = kwargs.pop("test", None) |
| 45 | super().__init__(**kwargs) |
| 46 | |
| 47 | register_implementation("testmem", TestMemoryFS, clobber=True) |
| 48 | yield TestMemoryFS() |
| 49 | registry.pop("testmem", None) |
| 50 | TestMemoryFS.test[0] = None |
| 51 | TestMemoryFS.store.clear() |
| 52 | |
| 53 | |
| 54 | @pytest.fixture |
nothing calls this directly
no test coverage detected