diff --git a/tests/conftest.py b/tests/conftest.py index a0111acde2..d0a0c3d4a3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,10 +7,12 @@ from textwrap import dedent from typing import TYPE_CHECKING, TypedDict, cast +import anndata as ad import pytest +from packaging.version import Version # just import for the IMPORTED check -import scanpy as _sc # noqa: F401 +from scanpy._compat import pkg_version if TYPE_CHECKING: # So editors understand that we’re using those fixtures import os @@ -155,3 +157,10 @@ def plt(): def exit_stack() -> Generator[ExitStack]: with ExitStack() as stack: yield stack + + +@pytest.fixture(autouse=True) +def anndata_settings(): + if pkg_version("anndata") >= Version("0.12"): + ad.settings.auto_shard_zarr_v3 = True + ad.settings.zarr_write_format = 3