Skip to content

Commit 1984bdf

Browse files
committed
Fix tests for numpy 1.26
1 parent 4af0024 commit 1984bdf

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

tests/ndarray/test_lazyexpr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,8 +1787,8 @@ def test_lazyexpr_2args():
17871787
)
17881788
def test_simpleproxy(xp, dtype):
17891789
try:
1790-
dtype_ = getattr(xp, dtype)
1791-
except AttributeError:
1790+
dtype_ = getattr(xp, dtype) if hasattr(xp, dtype) else np.dtype(dtype)
1791+
except FutureWarning:
17921792
dtype_ = np.dtype(dtype)
17931793
if dtype == "bool":
17941794
blosc_matrix = blosc2.asarray([True, False, False], dtype=np.dtype(dtype), chunks=(2,))

tests/ndarray/test_linalg.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -830,11 +830,8 @@ def test_diagonal(shape, chunkshape, offset):
830830
"dtype",
831831
["int32", "int64", "float32", "float64", "complex128"],
832832
)
833-
def test_linalgproxy(xp, dtype): # noqa : C901
834-
try:
835-
dtype_ = getattr(xp, dtype)
836-
except AttributeError:
837-
dtype_ = np.dtype(dtype)
833+
def test_linalgproxy(xp, dtype):
834+
dtype_ = getattr(xp, dtype) if hasattr(xp, dtype) else np.dtype(dtype)
838835
for name in linalg_funcs:
839836
if name == "transpose":
840837
continue # deprecated

0 commit comments

Comments
 (0)