diff options
author | Homu <homu@barosl.com> | 2015-08-17 15:38:37 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2015-08-17 15:38:37 +0900 |
commit | 4186b6db167507c96a27d8bdcd36cbe4dc4574a0 (patch) | |
tree | 791a794d7cda628bbfcb7128b919b3c52f94d62b /numpy/lib/tests/test_function_base.py | |
parent | 6e8b869d52ec5a1242df69bcd9323a4b0947933b (diff) | |
parent | 649ede494a069fc97ed4f0110f86cdb0707ae1ce (diff) | |
download | numpy-4186b6db167507c96a27d8bdcd36cbe4dc4574a0.tar.gz |
Auto merge of #6206 - jaimefrio:searchsorted_ndarray, r=njsmith
MANT: searchsorted should return base ndarrays always
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index b127f65f6..af9315d83 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -913,6 +913,15 @@ class TestDigitize(TestCase): x, bins = bins, x assert_raises(TypeError, digitize, x, bins) + def test_return_type(self): + # Functions returning indices should always return base ndarrays + class A(np.ndarray): + pass + a = np.arange(5).view(A) + b = np.arange(1, 3).view(A) + assert_(not isinstance(digitize(b, a, False), A)) + assert_(not isinstance(digitize(b, a, True), A)) + class TestUnwrap(TestCase): |