summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2013-08-12 16:56:38 -0700
committerMark Wiebe <mwwiebe@gmail.com>2013-08-12 18:04:55 -0700
commit9b56a1d1f1445cf30dfdd3e14d83ac66154f4719 (patch)
tree295c48390bfa97857a34a9bd2dd0acdda8079991 /numpy
parent3bd8e312418f88e698aa5bc963318d6a5480a51e (diff)
downloadnumpy-9b56a1d1f1445cf30dfdd3e14d83ac66154f4719.tar.gz
TST: Add test for additional ufunc.reduceat empty parameter case
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 ce2de57f5..b2d47d052 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -1270,6 +1270,14 @@ def test_reduceat_empty():
result = np.add.reduceat(x, indices)
assert_equal(result.dtype, x.dtype)
assert_equal(result.shape, (0,))
+ # Another case with a slightly different zero-sized shape
+ x = np.ones((5,2))
+ result = np.add.reduceat(x, [], axis=0)
+ assert_equal(result.dtype, x.dtype)
+ assert_equal(result.shape, (0, 2))
+ result = np.add.reduceat(x, [], axis=1)
+ assert_equal(result.dtype, x.dtype)
+ assert_equal(result.shape, (5, 0))
def test_complex_nan_comparisons():
nans = [complex(np.nan, 0), complex(0, np.nan), complex(np.nan, np.nan)]