Skip to content

Commit 0a831f3

Browse files
committed
Add numpy version check to tests
1 parent 595e089 commit 0a831f3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cuda_core/tests/test_graph.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def test_graph_capture_errors(init_cuda):
184184

185185

186186
@pytest.mark.parametrize("condition_value", [True, False])
187+
@pytest.mark.skipif(tuple(int(i) for i in np.__version__.split(".")[:2]) < (2, 1), reason="need numpy 2.1.0+")
187188
def test_graph_conditional_if(init_cuda, condition_value):
188189
mod = _common_kernels()
189190
add_one = mod.get_kernel("add_one")
@@ -234,6 +235,7 @@ def test_graph_conditional_if(init_cuda, condition_value):
234235

235236

236237
@pytest.mark.parametrize("condition_value", [True, False])
238+
@pytest.mark.skipif(tuple(int(i) for i in np.__version__.split(".")[:2]) < (2, 1), reason="need numpy 2.1.0+")
237239
def test_graph_conditional_if_else(init_cuda, condition_value):
238240
mod = _common_kernels()
239241
add_one = mod.get_kernel("add_one")
@@ -300,6 +302,7 @@ def test_graph_conditional_if_else(init_cuda, condition_value):
300302

301303

302304
@pytest.mark.parametrize("condition_value", [0, 1, 2, 3])
305+
@pytest.mark.skipif(tuple(int(i) for i in np.__version__.split(".")[:2]) < (2, 1), reason="need numpy 2.1.0+")
303306
def test_graph_conditional_switch(init_cuda, condition_value):
304307
mod = _common_kernels()
305308
add_one = mod.get_kernel("add_one")
@@ -385,6 +388,7 @@ def test_graph_conditional_switch(init_cuda, condition_value):
385388

386389

387390
@pytest.mark.parametrize("condition_value", [True, False])
391+
@pytest.mark.skipif(tuple(int(i) for i in np.__version__.split(".")[:2]) < (2, 1), reason="need numpy 2.1.0+")
388392
def test_graph_conditional_while(init_cuda, condition_value):
389393
mod = _common_kernels()
390394
add_one = mod.get_kernel("add_one")
@@ -428,6 +432,7 @@ def test_graph_conditional_while(init_cuda, condition_value):
428432
assert arr[0] == 0
429433

430434

435+
@pytest.mark.skipif(tuple(int(i) for i in np.__version__.split(".")[:2]) < (2, 1), reason="need numpy 2.1.0+")
431436
def test_graph_child_graph(init_cuda):
432437
mod = _common_kernels()
433438
add_one = mod.get_kernel("add_one")
@@ -466,6 +471,7 @@ def test_graph_child_graph(init_cuda):
466471
assert arr[1] == 3
467472

468473

474+
@pytest.mark.skipif(tuple(int(i) for i in np.__version__.split(".")[:2]) < (2, 1), reason="need numpy 2.1.0+")
469475
def test_graph_update(init_cuda):
470476
mod = _common_kernels()
471477
add_one = mod.get_kernel("add_one")

0 commit comments

Comments
 (0)