From 0c459a0f5b5ab1aaefe9467d2be2c64872100f8c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:59:38 +0200 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#1601) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- src/testing/anndata/_pytest.py | 2 +- tests/conftest.py | 2 +- tests/test_anncollection.py | 2 +- tests/test_backed_dense.py | 2 +- tests/test_backed_hdf5.py | 2 +- tests/test_backed_sparse.py | 2 +- tests/test_concatenate.py | 4 ++-- tests/test_concatenate_disk.py | 2 +- tests/test_dask.py | 2 +- tests/test_dask_view_mem.py | 2 +- tests/test_deprecations.py | 2 +- tests/test_gpu.py | 6 +++--- tests/test_helpers.py | 4 ++-- tests/test_io_elementwise.py | 2 +- tests/test_obsmvarm.py | 2 +- tests/test_obspvarp.py | 2 +- tests/test_raw.py | 2 +- tests/test_readwrite.py | 2 +- tests/test_repr.py | 2 +- tests/test_settings.py | 2 +- tests/test_views.py | 2 +- 22 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6d64c93e3..28cd3fcf5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.7 + rev: v0.6.1 hooks: - id: ruff types_or: [python, pyi, jupyter] diff --git a/src/testing/anndata/_pytest.py b/src/testing/anndata/_pytest.py index 8990a629f..d29ac334e 100644 --- a/src/testing/anndata/_pytest.py +++ b/src/testing/anndata/_pytest.py @@ -37,7 +37,7 @@ def _suppress_env_for_doctests(request: pytest.FixtureRequest) -> None: request.getfixturevalue("_doctest_env") -@pytest.fixture() +@pytest.fixture def _doctest_env( request: pytest.FixtureRequest, cache: pytest.Cache, tmp_path: Path ) -> Generator[None, None, None]: diff --git a/tests/conftest.py b/tests/conftest.py index d1875f5a8..65eff92b1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,7 +11,7 @@ from anndata.tests.helpers import subset_func # noqa: F401 -@pytest.fixture() +@pytest.fixture def backing_h5ad(tmp_path): return tmp_path / "test.h5ad" diff --git a/tests/test_anncollection.py b/tests/test_anncollection.py index bac02773d..aaef199e7 100644 --- a/tests/test_anncollection.py +++ b/tests/test_anncollection.py @@ -11,7 +11,7 @@ _dense = lambda a: a.toarray() if issparse(a) else a -@pytest.fixture() +@pytest.fixture def adatas(request): adata1 = ad.AnnData(X=request.param([[1, 2, 0], [4, 5, 0], [7, 8, 0]])) adata1.obs["a_test"] = ["a", "a", "b"] diff --git a/tests/test_backed_dense.py b/tests/test_backed_dense.py index 1f3c19c12..796cad511 100644 --- a/tests/test_backed_dense.py +++ b/tests/test_backed_dense.py @@ -23,7 +23,7 @@ def diskfmt(request): return request.param -@pytest.fixture() +@pytest.fixture def file(tmp_path: Path, diskfmt: Literal["h5ad", "zarr"]) -> h5py.File | zarr.Group: path = tmp_path / f"test.{diskfmt}" if diskfmt == "zarr": diff --git a/tests/test_backed_hdf5.py b/tests/test_backed_hdf5.py index b03144f80..6cb449e28 100644 --- a/tests/test_backed_hdf5.py +++ b/tests/test_backed_hdf5.py @@ -28,7 +28,7 @@ # ------------------------------------------------------------------------------- -@pytest.fixture() +@pytest.fixture def adata(): X_list = [ [1, 2, 3], diff --git a/tests/test_backed_sparse.py b/tests/test_backed_sparse.py index 4e5f5445d..36a725bf2 100644 --- a/tests/test_backed_sparse.py +++ b/tests/test_backed_sparse.py @@ -40,7 +40,7 @@ def diskfmt(request): N = 50 -@pytest.fixture() +@pytest.fixture def ondisk_equivalent_adata( tmp_path: Path, diskfmt: Literal["h5ad", "zarr"] ) -> tuple[AnnData, AnnData, AnnData, AnnData]: diff --git a/tests/test_concatenate.py b/tests/test_concatenate.py index 0e1cd7382..03126284b 100644 --- a/tests/test_concatenate.py +++ b/tests/test_concatenate.py @@ -292,7 +292,7 @@ def test_concatenate_layers(array_type, join_type): assert_equal(merged.X, merged.layers["a"]) -@pytest.fixture() +@pytest.fixture def obsm_adatas(): def gen_index(n): return [f"cell{i}" for i in range(n)] @@ -1575,7 +1575,7 @@ def test_concat_duplicated_columns(join_type): concat([a, b], join=join_type) -@pytest.mark.gpu() +@pytest.mark.gpu def test_error_on_mixed_device(): """https://github.com/scverse/anndata/issues/1083""" import cupy diff --git a/tests/test_concatenate_disk.py b/tests/test_concatenate_disk.py index df62dad39..c2c9eb95a 100644 --- a/tests/test_concatenate_disk.py +++ b/tests/test_concatenate_disk.py @@ -180,7 +180,7 @@ def test_concat_ordered_categoricals_retained(tmp_path, file_format): assert_eq_concat_on_disk(adatas, tmp_path, file_format) -@pytest.fixture() +@pytest.fixture def xxxm_adatas(): def gen_index(n): return [f"cell{i}" for i in range(n)] diff --git a/tests/test_dask.py b/tests/test_dask.py index a4d3e5cc2..59616171b 100644 --- a/tests/test_dask.py +++ b/tests/test_dask.py @@ -44,7 +44,7 @@ def diskfmt(request): return request.param -@pytest.fixture() +@pytest.fixture def adata(sizes): import dask.array as da import numpy as np diff --git a/tests/test_dask_view_mem.py b/tests/test_dask_view_mem.py index 2b18f1436..d0dc60ed6 100644 --- a/tests/test_dask_view_mem.py +++ b/tests/test_dask_view_mem.py @@ -38,7 +38,7 @@ def give_chunks(request): # Does some stuff so that dask can cache the # subclasscheck before the run. -@pytest.fixture() +@pytest.fixture def _alloc_cache(): import dask.array as da diff --git a/tests/test_deprecations.py b/tests/test_deprecations.py index 1be130ddc..7d4bdf6e2 100644 --- a/tests/test_deprecations.py +++ b/tests/test_deprecations.py @@ -20,7 +20,7 @@ from anndata.tests.helpers import assert_equal -@pytest.fixture() +@pytest.fixture def adata(): adata = AnnData( X=sparse.csr_matrix([[0, 2, 3], [0, 5, 6]], dtype=np.float32), diff --git a/tests/test_gpu.py b/tests/test_gpu.py index 63d7ee83d..c6f49a696 100644 --- a/tests/test_gpu.py +++ b/tests/test_gpu.py @@ -6,7 +6,7 @@ from anndata import AnnData, Raw -@pytest.mark.gpu() +@pytest.mark.gpu def test_gpu(): """ For testing that the gpu mark works @@ -16,7 +16,7 @@ def test_gpu(): cupy.ones(1) -@pytest.mark.gpu() +@pytest.mark.gpu def test_adata_raw_gpu(): import cupy as cp from cupyx.scipy import sparse as cupy_sparse @@ -28,7 +28,7 @@ def test_adata_raw_gpu(): assert isinstance(adata.raw.X, sparse.csr_matrix) -@pytest.mark.gpu() +@pytest.mark.gpu def test_raw_gpu(): import cupy as cp from cupyx.scipy import sparse as cupy_sparse diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 464c0f3a9..adf5a7dce 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -56,7 +56,7 @@ # assert tag in str(err.value) -@pytest.fixture() +@pytest.fixture def reusable_adata(): """Reusable anndata for when tests shouldn’t mutate it""" return gen_adata((10, 10)) @@ -333,7 +333,7 @@ def test_as_dask_functions(input_type, as_dask_type, mem_type): "dask_matrix_type", DASK_MATRIX_PARAMS, ) -@pytest.mark.gpu() +@pytest.mark.gpu def test_as_cupy_dask(dask_matrix_type): SHAPE = (100, 10) rng = np.random.default_rng(42) diff --git a/tests/test_io_elementwise.py b/tests/test_io_elementwise.py index 62284a0c9..ed89dbe7f 100644 --- a/tests/test_io_elementwise.py +++ b/tests/test_io_elementwise.py @@ -186,7 +186,7 @@ def test_io_spec(store, value, encoding_type): # Can't instantiate cupy types at the top level, so converting them within the test -@pytest.mark.gpu() +@pytest.mark.gpu @pytest.mark.parametrize( ("value", "encoding_type"), [ diff --git a/tests/test_obsmvarm.py b/tests/test_obsmvarm.py index 92f5b8fa0..63fbc9bc6 100644 --- a/tests/test_obsmvarm.py +++ b/tests/test_obsmvarm.py @@ -11,7 +11,7 @@ M, N = (100, 100) -@pytest.fixture() +@pytest.fixture def adata(): X = np.zeros((M, N)) obs = pd.DataFrame( diff --git a/tests/test_obspvarp.py b/tests/test_obspvarp.py index cc49cc15f..311a8d2bb 100644 --- a/tests/test_obspvarp.py +++ b/tests/test_obspvarp.py @@ -16,7 +16,7 @@ M, N = (200, 100) -@pytest.fixture() +@pytest.fixture def adata(): X = np.zeros((M, N)) obs = pd.DataFrame( diff --git a/tests/test_raw.py b/tests/test_raw.py index 4a57a52bf..a21f21f8a 100644 --- a/tests/test_raw.py +++ b/tests/test_raw.py @@ -33,7 +33,7 @@ ) -@pytest.fixture() +@pytest.fixture def adata_raw() -> ad.AnnData: adata = ad.AnnData( np.array(data, dtype="int32"), obs=obs_dict, var=var_dict, uns=uns_dict diff --git a/tests/test_readwrite.py b/tests/test_readwrite.py index 06f4a9a33..8ad2870c4 100644 --- a/tests/test_readwrite.py +++ b/tests/test_readwrite.py @@ -81,7 +81,7 @@ def diskfmt(request): return request.param -@pytest.fixture() +@pytest.fixture def rw(backing_h5ad): M, N = 100, 101 orig = gen_adata((M, N)) diff --git a/tests/test_repr.py b/tests/test_repr.py index 28cad954f..18fffb74f 100644 --- a/tests/test_repr.py +++ b/tests/test_repr.py @@ -12,7 +12,7 @@ ADATA_ATTRS = ("obs", "var", "varm", "obsm", "layers", "obsp", "varp", "uns") -@pytest.fixture() +@pytest.fixture def adata(): return ad.AnnData( np.zeros((20, 10)), diff --git a/tests/test_settings.py b/tests/test_settings.py index 7b9ce5865..871141d92 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -33,7 +33,7 @@ def validate_int_list(val) -> bool: return True -@pytest.fixture() +@pytest.fixture def settings() -> SettingsManager: settings = SettingsManager() settings.register(option, default_val, description, validate_bool) diff --git a/tests/test_views.py b/tests/test_views.py index 8212bc4f6..2d4a0a78d 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -65,7 +65,7 @@ def view(self, dtype=None, typ=None): return self -@pytest.fixture() +@pytest.fixture def adata(): adata = ad.AnnData(np.zeros((100, 100))) adata.obsm["o"] = np.zeros((100, 50))