2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-21 05:02:17 +00:00

ufunc tests now ensure that return value is the same object as the 'output' (if it is provided) argument being the same object as the ufunc return value

This commit is contained in:
Ilya Kolpakov
2012-09-04 11:55:30 +02:00
parent ca3526c76a
commit 46b959cceb

View File

@@ -19,7 +19,7 @@ class TestUnary(unittest.TestCase):
assert_array_almost_equal(b, a*2.0)
c = numpy.zeros(5, dtype=float)
d = f(a,output=c)
assert_array_almost_equal(c, a*2.0)
self.assert_(c is d)
assert_array_almost_equal(d, a*2.0)
def testList(self):
@@ -42,7 +42,7 @@ class TestBinary(unittest.TestCase):
assert_array_almost_equal(f(a,b), (a*2+b*3))
c = numpy.zeros(5, dtype=float)
d = f(a,b,output=c)
assert_array_almost_equal(c, a*2 + b*3)
self.assert_(c is d)
assert_array_almost_equal(d, a*2 + b*3)
assert_array_almost_equal(f(a, 2.0), a*2 + 6.0)
assert_array_almost_equal(f(1.0, b), 2.0 + b*3)