From 9f89f6c1b87ce5458521ec89a06180913a17893b Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Mon, 31 Jul 2023 23:01:44 -0600 Subject: [PATCH] Fix deprecation warning from newer NumPys in the tests --- ndindex/tests/test_tuple.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ndindex/tests/test_tuple.py b/ndindex/tests/test_tuple.py index bcd854aa..8297ed7d 100644 --- a/ndindex/tests/test_tuple.py +++ b/ndindex/tests/test_tuple.py @@ -1,6 +1,6 @@ from itertools import product -from numpy import arange, array, intp, empty +from numpy import arange, array, intp, empty, all as np_all from hypothesis import given, example from hypothesis.strategies import integers, one_of @@ -104,6 +104,7 @@ def test_tuple_reduce_no_shape_hypothesis(t, shape, kwargs): # Idempotency assert reduced.reduce(**kwargs) == reduced +@example((..., empty((1, 0), dtype=intp)), (1, 0), {}) @example((1, -1, [1, -1]), (3, 3, 3), {'negative_int': True}) @example((..., None), (), {}) @example((..., empty((0, 0), dtype=bool)), (0, 0), {}) @@ -155,9 +156,9 @@ def test_tuple_reduce_hypothesis(t, shape, kwargs): assert arg.raw >= 0 elif isinstance(arg, IntegerArray): if negative_int: - assert all(arg.raw < 0) + assert np_all(arg.raw < 0) else: - assert all(arg.raw >= 0) + assert np_all(arg.raw >= 0) def test_tuple_reduce_explicit(): # Some aspects of Tuple.reduce are hard to test as properties, so include