diff options
author | John Kirkham <kirkhamj@janelia.hhmi.org> | 2016-01-09 16:26:40 -0500 |
---|---|---|
committer | John Kirkham <kirkhamj@janelia.hhmi.org> | 2016-01-11 19:42:27 -0500 |
commit | 67592d34fa0bc09fb20686cc76565e3153c0c958 (patch) | |
tree | f796c2a5be4c2b8125522f2dc306cac80e4dec5c | |
parent | b491cc8916e7ac1bf974fab8c2f9b65b17a90457 (diff) | |
download | numpy-67592d34fa0bc09fb20686cc76565e3153c0c958.tar.gz |
TST: Ensure `inner` 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 881c9c783..c9e610cbf 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -4832,6 +4832,13 @@ if sys.version_info[:2] >= (3, 5): class TestInner(TestCase): + def test_inner_type_mismatch(self): + c = 1. + A = np.array((1,1), dtype='i,i') + + assert_raises(TypeError, np.inner, c, A) + assert_raises(TypeError, np.inner, A, c) + def test_inner_scalar_and_vector(self): for dt in np.typecodes['AllInteger'] + np.typecodes['AllFloat'] + '?': sca = np.array(3, dtype=dt)[()] |