diff --git a/changes/2768.bugfix.1.rst b/changes/2768.bugfix.1.rst new file mode 100644 index 0000000000..b732b742ef --- /dev/null +++ b/changes/2768.bugfix.1.rst @@ -0,0 +1 @@ +Updated the optional test dependencies to include ``botocore`` and ``fsspec``. diff --git a/changes/2768.bugfix.2.rst b/changes/2768.bugfix.2.rst new file mode 100644 index 0000000000..1bf5fb8a85 --- /dev/null +++ b/changes/2768.bugfix.2.rst @@ -0,0 +1,2 @@ +Fixed the fsspec tests to skip if ``botocore`` is not installed. +Previously they would have failed with an import error. diff --git a/pyproject.toml b/pyproject.toml index e7a1c5c2c4..8d73485dac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,10 +73,12 @@ test = [ "coverage", "pytest", "pytest-cov", + 'zarr[remote]', + "botocore", "s3fs", + "moto[s3,server]", "pytest-asyncio", "pytest-accept", - "moto[s3,server]", "requests", "rich", "mypy", diff --git a/tests/test_store/test_fsspec.py b/tests/test_store/test_fsspec.py index a560ca02e8..929de37869 100644 --- a/tests/test_store/test_fsspec.py +++ b/tests/test_store/test_fsspec.py @@ -5,7 +5,6 @@ from typing import TYPE_CHECKING import pytest -from botocore.session import Session from packaging.version import parse as parse_version import zarr.api.asynchronous @@ -26,6 +25,7 @@ requests = pytest.importorskip("requests") moto_server = pytest.importorskip("moto.moto_server.threaded_moto_server") moto = pytest.importorskip("moto") +botocore = pytest.importorskip("botocore") # ### amended from s3fs ### # test_bucket_name = "test" @@ -52,7 +52,7 @@ def s3_base() -> Generator[None, None, None]: def get_boto3_client() -> botocore.client.BaseClient: # NB: we use the sync botocore client for setup - session = Session() + session = botocore.session.Session() return session.create_client("s3", endpoint_url=endpoint_url)