summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_umath.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index a696fceb8..2accb6386 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -267,6 +267,14 @@ class TestComparisons:
a = np.array([np.nan], dtype=object)
assert_equal(np.not_equal(a, a), [True])
+ def test_error_in_equal_reduce(self):
+ # gh-20929
+ # make sure np.equal.reduce raises a TypeError if an array is passed
+ # without specifying the dtype
+ a = np.array([0, 0])
+ assert_equal(np.equal.reduce(a, dtype=bool), True)
+ assert_raises(TypeError, np.equal.reduce, a)
+
class TestAdd:
def test_reduce_alignment(self):