diff options
author | John Kirkham <kirkhamj@janelia.hhmi.org> | 2016-01-09 16:24:44 -0500 |
---|---|---|
committer | John Kirkham <kirkhamj@janelia.hhmi.org> | 2016-01-11 19:42:27 -0500 |
commit | b491cc8916e7ac1bf974fab8c2f9b65b17a90457 (patch) | |
tree | bf825a349ed8553caf680f7ca4b768978022947a | |
parent | 4b82b1bba72ef7539c06a4577b7102da9564ca02 (diff) | |
download | numpy-b491cc8916e7ac1bf974fab8c2f9b65b17a90457.tar.gz |
TST: Ensure `dot` fails correctly if array types cannot be coerced into a common type.
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 04e09d37f..881c9c783 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -2041,6 +2041,13 @@ class TestMethods(TestCase): assert_raises(TypeError, np.dot, b, c) assert_raises(TypeError, c.dot, b) + def test_dot_type_mismatch(self): + c = 1. + A = np.array((1,1), dtype='i,i') + + assert_raises(ValueError, np.dot, c, A) + assert_raises(TypeError, np.dot, A, c) + def test_diagonal(self): a = np.arange(12).reshape((3, 4)) assert_equal(a.diagonal(), [0, 5, 10]) |