Skip to content

Commit 271869c

Browse files
committed
Use fixtures
1 parent 176e954 commit 271869c

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

tests/test_sdata_points_zorder.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616
def is_sorted(l):
1717
return all(l[i] <= l[i + 1] for i in range(len(l) - 1))
1818

19-
def get_sdata():
19+
20+
@pytest.fixture
21+
def sdata_with_points():
2022
data_dir = join("docs", "notebooks", "data")
2123
spatialdata_filepath = join(data_dir, "xenium_rep1_io.spatialdata.zarr")
2224

2325
sdata = read_zarr(spatialdata_filepath)
2426
return sdata
2527

26-
@pytest.mark.skip(reason="Temporarily disable")
27-
def test_zorder_sorting():
28-
# TODO: use fixture here
29-
sdata = get_sdata()
28+
29+
def test_zorder_sorting(sdata_with_points):
30+
sdata = sdata_with_points
3031

3132
sdata_morton_sort_points(sdata, "transcripts")
3233

@@ -37,9 +38,8 @@ def test_zorder_sorting():
3738
assert is_sorted(morton_sorted)
3839

3940

40-
41-
def test_zorder_query():
42-
sdata = get_sdata()
41+
def test_zorder_query(sdata_with_points):
42+
sdata = sdata_with_points
4343

4444
sdata_morton_sort_points(sdata, "transcripts")
4545

@@ -174,10 +174,3 @@ def test_zorder_query():
174174
assert len(estimated_row_indices) <= 17643
175175

176176

177-
178-
179-
180-
181-
182-
183-

0 commit comments

Comments
 (0)