Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Run fsspec tests
shell: bash -l {0}
run: |
pytest -v fsspec/tests/test_downstream.py
pytest -v tests/test_downstream.py

- name: Run dask tests
shell: bash -l {0}
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ raw-options = { 'version_scheme' = 'post-release' }
[tool.hatch.build.hooks.vcs]
version-file = "fsspec/_version.py"

[tool.hatch.build]
exclude = ["**/tests/*", "!**/tests/abstract/"]

[tool.ruff]
exclude = [".tox", "build", "docs/source/conf.py", "fsspec/_version"]
line-length = 88
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions fsspec/tests/conftest.py → tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import pytest

from fsspec.conftest import ftp_writable, instance_caches, m # noqa: F401

requests = pytest.importorskip("requests")
data = b"\n".join([b"some test data"] * 1000)
listing = open(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fsspec.tests.abstract as abstract
from fsspec.implementations.tests.local.local_fixtures import LocalFixtures

from .local_fixtures import LocalFixtures


class TestLocalCopy(abstract.AbstractCopyTests, LocalFixtures):
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fsspec.tests.abstract as abstract
from fsspec.implementations.tests.memory.memory_fixtures import MemoryFixtures

from .memory_fixtures import MemoryFixtures


class TestMemoryCopy(abstract.AbstractCopyTests, MemoryFixtures):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
)
from fsspec.implementations.local import make_path_posix
from fsspec.implementations.zip import ZipFileSystem
from fsspec.tests.conftest import win

from ..conftest import win
from .test_ftp import FTPFileSystem


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import pytest

from fsspec import AbstractFileSystem
from fsspec.implementations.tests.conftest import READ_ONLY_FILESYSTEMS

from .conftest import READ_ONLY_FILESYSTEMS


@pytest.mark.parametrize("fs", ["local"], indirect=["fs"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import pytest

import fsspec.asyn
import fsspec.utils
from fsspec.implementations.http import HTTPStreamFile
from fsspec.tests.conftest import data, reset_files, server, win # noqa: F401

from ..conftest import data, reset_files, server, win # noqa: F401


def test_list(server):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import pytest

import fsspec.utils
from fsspec.tests.conftest import data, requests, reset_files, server, win # noqa: F401

from ..conftest import data, requests, reset_files, server, win # noqa: F401


@pytest.fixture()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# this test case checks that the libarchive can be used from a seekable source (any fs
# with a block cache active)
import fsspec
from fsspec.implementations.tests.test_archive import archive_data, temparchive

from .test_archive import archive_data, temparchive


def test_cache(ftp_writable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from fsspec import compression
from fsspec.core import OpenFile, get_fs_token_paths, open_files
from fsspec.implementations.local import LocalFileSystem, get_umask, make_path_posix
from fsspec.tests.test_utils import WIN

from ..test_utils import WIN

files = {
".test.accounts.1.json": (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
ReferenceFileSystem,
ReferenceNotReachable,
)
from fsspec.tests.conftest import data, reset_files, server, win # noqa: F401

from ..conftest import data, reset_files, server, win # noqa: F401


def test_simple(server):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
from fsspec.core import OpenFile
from fsspec.implementations.cached import WholeFileCacheFileSystem
from fsspec.implementations.tar import TarFileSystem
from fsspec.implementations.tests.test_archive import archive_data, temptar

from .test_archive import archive_data, temptar

if TYPE_CHECKING:
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import pytest

import fsspec
from fsspec.implementations.tests.test_archive import archive_data, tempzip
from fsspec.implementations.zip import ZipFileSystem

from .test_archive import archive_data, tempzip


def test_info():
with tempzip(archive_data) as z:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fsspec/tests/test_file.py → tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from fsspec.implementations.tests.test_ftp import FTPFileSystem
from .implementations.test_ftp import FTPFileSystem

data = b"hello" * 10000

Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion fsspec/tests/test_generic.py → tests/test_generic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pytest

import fsspec
from fsspec.tests.conftest import data, server # noqa: F401

from .conftest import data, server # noqa: F401


def test_remote_async_ops(server):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 8 additions & 3 deletions fsspec/tests/test_spec.py → tests/test_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from fsspec.implementations.http import HTTPFileSystem
from fsspec.implementations.local import LocalFileSystem
from fsspec.spec import AbstractBufferedFile, AbstractFileSystem
from fsspec.tests.conftest import data

from .conftest import data

PATHS_FOR_GLOB_TESTS = (
{"name": "test0.json", "type": "file", "size": 100},
Expand Down Expand Up @@ -1039,10 +1040,14 @@ def test_serialize_with_password():


def test_from_dict_valid():
fs = DummyTestFS.from_dict({"cls": "fsspec.tests.test_spec.DummyTestFS"})
fs = DummyTestFS.from_dict(
{"cls": f"{test_from_dict_valid.__module__}.DummyTestFS"}
)
assert isinstance(fs, DummyTestFS)

fs = DummyTestFS.from_dict({"cls": "fsspec.tests.test_spec.DummyTestFS", "bar": 1})
fs = DummyTestFS.from_dict(
{"cls": f"{test_from_dict_valid.__module__}.DummyTestFS", "bar": 1}
)
assert fs.storage_options["bar"] == 1

fs = DummyTestFS.from_dict({"cls": "fsspec.implementations.local.LocalFileSystem"})
Expand Down
File renamed without changes.
Loading