diff options
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/tests/test_scalarmath.py | 12 | ||||
-rw-r--r-- | numpy/core/tests/test_umath.py | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/numpy/core/tests/test_scalarmath.py b/numpy/core/tests/test_scalarmath.py index f9aeb6382..0ae013f12 100644 --- a/numpy/core/tests/test_scalarmath.py +++ b/numpy/core/tests/test_scalarmath.py @@ -73,7 +73,7 @@ class TestBaseMath(TestCase): inp1[...] = np.ones_like(inp1) inp2[...] = np.zeros_like(inp2) assert_almost_equal(np.add(inp1, inp2), exp1, err_msg=msg) - assert_almost_equal(np.add(inp1, 1), exp1 + 1, err_msg=msg) + assert_almost_equal(np.add(inp1, 2), exp1 + 2, err_msg=msg) assert_almost_equal(np.add(1, inp2), exp1, err_msg=msg) np.add(inp1, inp2, out=out) @@ -88,11 +88,11 @@ class TestBaseMath(TestCase): np.divide(1, inp2), err_msg=msg) inp1[...] = np.ones_like(inp1) - inp2[...] = np.zeros_like(inp2) - np.add(inp1, 1, out=out) - assert_almost_equal(out, exp1 + 1, err_msg=msg) - np.add(1, inp2, out=out) - assert_almost_equal(out, exp1, err_msg=msg) + np.add(inp1, 2, out=out) + assert_almost_equal(out, exp1 + 2, err_msg=msg) + inp2[...] = np.ones_like(inp2) + np.add(2, inp2, out=out) + assert_almost_equal(out, exp1 + 2, err_msg=msg) def test_lower_align(self): # check data that is not aligned to element size diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 759e996e3..db5621279 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -1202,8 +1202,9 @@ class TestAbsoluteNegative(TestCase): assert_array_equal(out, d, err_msg=msg) assert_array_equal(-inp, -1*inp, err_msg=msg) + d = -1 * inp np.negative(inp, out=out) - assert_array_equal(out, -1*inp, err_msg=msg) + assert_array_equal(out, d, err_msg=msg) def test_lower_align(self): # check data that is not aligned to element size |