File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 8
8
import ufunc_ext
9
9
import unittest
10
10
import 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
12
15
13
16
class TestUnary (unittest .TestCase ):
14
17
@@ -24,7 +27,7 @@ def testArray(self):
24
27
assert_array_almost_equal (b , a * 2.0 )
25
28
c = numpy .zeros (5 , dtype = float )
26
29
d = f (a ,output = c )
27
- self .assertTrue (c is d )
30
+ self .assertTrue (( c == d ). all () )
28
31
assert_array_almost_equal (d , a * 2.0 )
29
32
30
33
def testList (self ):
@@ -47,7 +50,7 @@ def testArray(self):
47
50
assert_array_almost_equal (f (a ,b ), (a * 2 + b * 3 ))
48
51
c = numpy .zeros (5 , dtype = float )
49
52
d = f (a ,b ,output = c )
50
- self .assertTrue (c is d )
53
+ self .assertTrue (( c == d ). all () )
51
54
assert_array_almost_equal (d , a * 2 + b * 3 )
52
55
assert_array_almost_equal (f (a , 2.0 ), a * 2 + 6.0 )
53
56
assert_array_almost_equal (f (1.0 , b ), 2.0 + b * 3 )
You can’t perform that action at this time.
0 commit comments