diff options
author | jaimefrio <jaime.frio@gmail.com> | 2014-12-07 19:32:36 -0800 |
---|---|---|
committer | jaimefrio <jaime.frio@gmail.com> | 2014-12-07 19:37:15 -0800 |
commit | 0e8edab421e3b20ff2f4085e06040101c2d9865f (patch) | |
tree | 1ae35f79647239b4832d7b0849776c0d014771cf /numpy/lib/tests/test_function_base.py | |
parent | 545d485751b3b2c1f68e36dbc4ea64ca50876a59 (diff) | |
download | numpy-0e8edab421e3b20ff2f4085e06040101c2d9865f.tar.gz |
BUG: digitize segfaults on TypeError
The new searchsorted-based digitize introduced in #5101 segfaults
when it should raise a TypeError.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 80faf85a6..03521ca4c 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -861,6 +861,13 @@ class TestDigitize(TestCase): bins = [1, 1, 0, 1] assert_raises(ValueError, digitize, x, bins) + def test_casting_error(self): + x = [1, 2, 3+1.j] + bins = [1, 2, 3] + assert_raises(TypeError, digitize, x, bins) + x, bins = bins, x + assert_raises(TypeError, digitize, x, bins) + class TestUnwrap(TestCase): def test_simple(self): |