Skip to content

Commit 07c7200

Browse files
committed
Fix flow_direction test parametrize: add missing size/dtype params
The cross-backend tests parametrize size and dtype for the random_data fixture but the test functions didn't declare those parameters, causing pytest collection to fail.
1 parent 1e75c30 commit 07c7200

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

xrspatial/hydro/tests/test_flow_direction_d8.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def test_nan_edges():
230230
@pytest.mark.parametrize("size", [(4, 6), (10, 15)])
231231
@pytest.mark.parametrize(
232232
"dtype", [np.int32, np.int64, np.float32, np.float64])
233-
def test_numpy_equals_dask(random_data):
233+
def test_numpy_equals_dask(random_data, size, dtype):
234234
numpy_agg = create_test_raster(random_data, backend='numpy')
235235
dask_agg = create_test_raster(random_data, backend='dask')
236236
assert_numpy_equals_dask_numpy(numpy_agg, dask_agg, flow_direction)
@@ -240,7 +240,7 @@ def test_numpy_equals_dask(random_data):
240240
@pytest.mark.parametrize("size", [(4, 6), (10, 15)])
241241
@pytest.mark.parametrize(
242242
"dtype", [np.int32, np.int64, np.float32, np.float64])
243-
def test_numpy_equals_cupy(random_data):
243+
def test_numpy_equals_cupy(random_data, size, dtype):
244244
numpy_agg = create_test_raster(random_data, backend='numpy')
245245
cupy_agg = create_test_raster(random_data, backend='cupy')
246246
assert_numpy_equals_cupy(numpy_agg, cupy_agg, flow_direction)
@@ -251,7 +251,7 @@ def test_numpy_equals_cupy(random_data):
251251
@pytest.mark.parametrize("size", [(4, 6), (10, 15)])
252252
@pytest.mark.parametrize(
253253
"dtype", [np.int32, np.int64, np.float32, np.float64])
254-
def test_numpy_equals_dask_cupy(random_data):
254+
def test_numpy_equals_dask_cupy(random_data, size, dtype):
255255
numpy_agg = create_test_raster(random_data, backend='numpy')
256256
dask_cupy_agg = create_test_raster(random_data, backend='dask+cupy')
257257
assert_numpy_equals_dask_cupy(numpy_agg, dask_cupy_agg, flow_direction,

xrspatial/hydro/tests/test_flow_direction_dinf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def test_dataset_support():
361361
@pytest.mark.parametrize("size", [(4, 6), (10, 15)])
362362
@pytest.mark.parametrize(
363363
"dtype", [np.int32, np.int64, np.float32, np.float64])
364-
def test_numpy_equals_dask(random_data):
364+
def test_numpy_equals_dask(random_data, size, dtype):
365365
numpy_agg = create_test_raster(random_data, backend='numpy')
366366
dask_agg = create_test_raster(random_data, backend='dask')
367367
assert_numpy_equals_dask_numpy(numpy_agg, dask_agg, flow_direction_dinf)
@@ -371,7 +371,7 @@ def test_numpy_equals_dask(random_data):
371371
@pytest.mark.parametrize("size", [(4, 6), (10, 15)])
372372
@pytest.mark.parametrize(
373373
"dtype", [np.int32, np.int64, np.float32, np.float64])
374-
def test_numpy_equals_cupy(random_data):
374+
def test_numpy_equals_cupy(random_data, size, dtype):
375375
numpy_agg = create_test_raster(random_data, backend='numpy')
376376
cupy_agg = create_test_raster(random_data, backend='cupy')
377377
assert_numpy_equals_cupy(numpy_agg, cupy_agg, flow_direction_dinf)
@@ -382,7 +382,7 @@ def test_numpy_equals_cupy(random_data):
382382
@pytest.mark.parametrize("size", [(4, 6), (10, 15)])
383383
@pytest.mark.parametrize(
384384
"dtype", [np.int32, np.int64, np.float32, np.float64])
385-
def test_numpy_equals_dask_cupy(random_data):
385+
def test_numpy_equals_dask_cupy(random_data, size, dtype):
386386
numpy_agg = create_test_raster(random_data, backend='numpy')
387387
dask_cupy_agg = create_test_raster(random_data, backend='dask+cupy')
388388
assert_numpy_equals_dask_cupy(numpy_agg, dask_cupy_agg,

0 commit comments

Comments
 (0)