Skip to content

Commit df7b4d1

Browse files
committed
TST: skip array_conversion tests for python < 3.12
1 parent ddc14d8 commit df7b4d1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

array_api_strict/tests/test_array_object.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import operator
23
from builtins import all as all_
34

@@ -351,6 +352,10 @@ def test_array_properties():
351352
assert b.mT.shape == (3, 2)
352353

353354

355+
@pytest.mark.xfail(sys.version_info.major*100 + sys.version_info.minor < 312,
356+
reason="array conversion relies on buffer protocol, and "
357+
"requires python >= 3.12"
358+
)
354359
def test_array_conversion():
355360
# Check that arrays on the CPU device can be converted to NumPy
356361
# but arrays on other devices can't. Note this is testing the logic in

array_api_strict/tests/test_creation_functions.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import warnings
23

34
from numpy.testing import assert_raises
@@ -97,7 +98,12 @@ def test_asarray_copy():
9798
a[0] = 0
9899
assert all(b[0] == 0)
99100

100-
def test_asarray_list_of_lists():
101+
102+
@pytest.mark.xfail(sys.version_info.major*100 + sys.version_info.minor < 312,
103+
reason="array conversion relies on buffer protocol, and "
104+
"requires python >= 3.12"
105+
)
106+
def test_asarray_list_of_arrays():
101107
a = asarray(1, dtype=int16)
102108
b = asarray([1], dtype=int16)
103109
res = asarray([a, a])

0 commit comments

Comments
 (0)