File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 88import ufunc_ext
99import unittest
1010import numpy
11- from numpy .testing .utils import assert_array_almost_equal
11+ try :
12+ from numpy .testing import assert_array_almost_equal
13+ except ImportError :
14+ from numpy .testing .utils import assert_array_almost_equal
1215
1316class TestUnary (unittest .TestCase ):
1417
@@ -24,7 +27,7 @@ def testArray(self):
2427 assert_array_almost_equal (b , a * 2.0 )
2528 c = numpy .zeros (5 , dtype = float )
2629 d = f (a ,output = c )
27- self .assertTrue (c is d )
30+ self .assertTrue (( c == d ). all () )
2831 assert_array_almost_equal (d , a * 2.0 )
2932
3033 def testList (self ):
@@ -47,7 +50,7 @@ def testArray(self):
4750 assert_array_almost_equal (f (a ,b ), (a * 2 + b * 3 ))
4851 c = numpy .zeros (5 , dtype = float )
4952 d = f (a ,b ,output = c )
50- self .assertTrue (c is d )
53+ self .assertTrue (( c == d ). all () )
5154 assert_array_almost_equal (d , a * 2 + b * 3 )
5255 assert_array_almost_equal (f (a , 2.0 ), a * 2 + 6.0 )
5356 assert_array_almost_equal (f (1.0 , b ), 2.0 + b * 3 )
You can’t perform that action at this time.
0 commit comments