diff options
author | Ondřej Čertík <ondrej.certik@gmail.com> | 2012-08-30 19:52:48 -0700 |
---|---|---|
committer | Ondřej Čertík <ondrej.certik@gmail.com> | 2012-08-31 15:49:26 -0700 |
commit | cb5a27eacb0165752fc5ab82633911d90df28af4 (patch) | |
tree | 83c008c119c313c543d7de3dd528b6a0402235f3 | |
parent | e60c70d7ca5dbe45860c44673ddab02d47770155 (diff) | |
download | numpy-cb5a27eacb0165752fc5ab82633911d90df28af4.tar.gz |
BUG: Add a test for Ticket #2189
-rw-r--r-- | numpy/core/tests/test_regression.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 08431c6f0..6096e9826 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -1737,5 +1737,11 @@ class TestRegression(TestCase): # Check the final string: assert_(y == "[0 0]") + def test_searchsorted_wrong_dtype(self): + # Ticket #2189, it used to segfault, so we check that it raises the + # proper exception. + a = np.array([('a', 1)], dtype='S1, int') + assert_raises(TypeError, np.searchsorted, a, 1.2) + if __name__ == "__main__": run_module_suite() |