Skip to content

Commit 29dd4ee

Browse files
committed
Backport PR #1932: (fix): force dask cluster tests to be run in same process
1 parent 193b50a commit 29dd4ee

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Home-page = "https://github.com/scverse/anndata"
6161
dev = [
6262
# runtime dev version generation
6363
"hatch-vcs",
64-
"anndata[dev-doc,dev-test]",
64+
"anndata[dev-doc,test]",
6565
]
6666
doc = [
6767
"sphinx>=8.2.1",
@@ -91,20 +91,20 @@ test = [
9191
"pytest-memray",
9292
"pytest-mock",
9393
"zarr<3",
94+
"pytest-xdist[psutil]",
9495
"filelock",
9596
"matplotlib",
9697
"scikit-learn",
9798
"openpyxl",
9899
"joblib",
99100
"boltons",
100101
"scanpy>=1.9.8",
101-
"httpx", # For data downloading
102+
"httpx", # For data downloading
102103
"dask[distributed]",
103104
"awkward>=2.3",
104105
"pyarrow",
105106
"anndata[dask]",
106107
]
107-
dev-test = [ "pytest-xdist[psutil]" ] # local test speedups
108108
gpu = [ "cupy" ]
109109
cu12 = [ "cupy-cuda12x" ]
110110
cu11 = [ "cupy-cuda11x" ]
@@ -142,6 +142,7 @@ addopts = [
142142
"--doctest-modules",
143143
"--pyargs",
144144
"-ptesting.anndata._pytest",
145+
"--dist=loadgroup",
145146
]
146147
filterwarnings = [
147148
"ignore::anndata._warnings.OldFormatWarning",

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from dask.base import normalize_seq
1414
else:
1515
from dask.tokenize import normalize_seq
16+
1617
from filelock import FileLock
1718
from scipy import sparse
1819

tests/test_dask.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def test_dask_write(adata, tmp_path, diskfmt):
110110
assert isinstance(orig.varm["a"], DaskArray)
111111

112112

113+
@pytest.mark.xdist_group("dask")
113114
def test_dask_distributed_write(
114115
adata: AnnData,
115116
tmp_path: Path,

tests/test_io_elementwise.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ def test_read_lazy_subsets_nd_dask(store, n_dims, chunks):
345345
assert_equal(X_from_disk[index], X_dask_from_disk[index])
346346

347347

348+
@pytest.mark.xdist_group("dask")
348349
def test_read_lazy_h5_cluster(
349350
sparse_format: Literal["csr", "csc"], tmp_path: Path, local_cluster_addr: str
350351
) -> None:

0 commit comments

Comments
 (0)