Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip COO matrix tests for newer anndata #3442

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
17 changes: 15 additions & 2 deletions tests/test_qc_metrics.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from __future__ import annotations

from importlib.metadata import version

import numpy as np
import pandas as pd
import pytest
from anndata import AnnData
from anndata.tests.helpers import assert_equal
from packaging.version import Version
from scipy import sparse

import scanpy as sc
Expand All @@ -18,7 +21,7 @@
)
from testing.scanpy._helpers import as_sparse_dask_array, maybe_dask_process_context
from testing.scanpy._pytest.marks import needs
from testing.scanpy._pytest.params import ARRAY_TYPES
from testing.scanpy._pytest.params import ARRAY_TYPES, ARRAY_TYPES_MEM


@pytest.fixture
Expand Down Expand Up @@ -198,8 +201,18 @@ def adata_mito():
return adata_dense, init_var


skip_if_adata_0_11_4 = pytest.mark.skipif(
Version(version("anndata")) >= Version("0.11.4.dev2"),
reason="Old AnnData doesn’t have sparse test helpers",
)


@pytest.mark.parametrize(
"cls", [np.asarray, sparse.csr_matrix, sparse.csc_matrix, sparse.coo_matrix]
"cls",
[
*ARRAY_TYPES_MEM,
pytest.param(sparse.coo_matrix, marks=[skip_if_adata_0_11_4], id="scipy_coo"),
],
)
def test_qc_metrics_format(cls):
adata_dense, init_var = adata_mito()
Expand Down
Loading