diff options
author | Mark Wiebe <mwiebe@enthought.com> | 2011-07-01 19:05:09 -0500 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-07-06 16:24:13 -0600 |
commit | ced013e6beb0e9cc8655a586579ac4fd3ac29551 (patch) | |
tree | 6e5aff1277aa2324df313c3836a3cc11a6aaea1b | |
parent | 8b506a28bf3c4be6e3b333eab6ec6856a383833d (diff) | |
download | numpy-ced013e6beb0e9cc8655a586579ac4fd3ac29551.tar.gz |
TST: umath: Add tests for casting output parameters
-rw-r--r-- | numpy/core/tests/test_ufunc.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py index cc5a79772..6940bd5d4 100644 --- a/numpy/core/tests/test_ufunc.py +++ b/numpy/core/tests/test_ufunc.py @@ -499,5 +499,12 @@ class TestUfunc(TestCase): np.subtract(a, 2, out=a, where=[True,False]) assert_equal(a, [[0, 27], [14, 5]]) + # With casting on output + a = np.ones(10, np.int64) + b = np.ones(10, np.int64) + c = np.ones(10, np.float64) + np.add(a, b, out=c, where=[1,0,0,1,0,0,1,1,1,0]) + assert_equal(c, [2,1,1,2,1,1,2,2,2,1]) + if __name__ == "__main__": run_module_suite() |