@@ -69,7 +69,7 @@ def sanity_check(x1, x2):
69
69
except ValueError :
70
70
raise RuntimeError ("Error in test generation (probably a bug in the test suite" )
71
71
72
- @given (numeric_scalars )
72
+ @given (xps . arrays ( dtype = xps . numeric_dtypes (), shape = shapes ) )
73
73
def test_abs (x ):
74
74
if is_integer_dtype (x .dtype ):
75
75
minval = dtype_ranges [x .dtype ][0 ]
@@ -86,7 +86,7 @@ def test_abs(x):
86
86
# abs(x) = x for x >= 0
87
87
assert_exactly_equal (a [logical_not (less_zero )], x [logical_not (less_zero )])
88
88
89
- @given (floating_scalars )
89
+ @given (xps . arrays ( dtype = xps . floating_dtypes (), shape = shapes ) )
90
90
def test_acos (x ):
91
91
a = xp .acos (x )
92
92
ONE = one (x .shape , x .dtype )
@@ -100,7 +100,7 @@ def test_acos(x):
100
100
# nan, which is already tested in the special cases.
101
101
assert_exactly_equal (domain , codomain )
102
102
103
- @given (floating_scalars )
103
+ @given (xps . arrays ( dtype = xps . floating_dtypes (), shape = shapes ) )
104
104
def test_acosh (x ):
105
105
a = xp .acosh (x )
106
106
ONE = one (x .shape , x .dtype )
@@ -112,9 +112,9 @@ def test_acosh(x):
112
112
# to nan, which is already tested in the special cases.
113
113
assert_exactly_equal (domain , codomain )
114
114
115
- @given (two_numeric_dtypes . flatmap ( lambda i : two_array_scalars ( * i ) ))
116
- def test_add (args ):
117
- x1 , x2 = args
115
+ @given (two_mutual_arrays ( numeric_dtype_objects ))
116
+ def test_add (x1_and_x2 ):
117
+ x1 , x2 = x1_and_x2
118
118
sanity_check (x1 , x2 )
119
119
a = xp .add (x1 , x2 )
120
120
@@ -123,7 +123,7 @@ def test_add(args):
123
123
assert_exactly_equal (a , b )
124
124
# TODO: Test that add is actually addition
125
125
126
- @given (floating_scalars )
126
+ @given (xps . arrays ( dtype = xps . floating_dtypes (), shape = shapes ) )
127
127
def test_asin (x ):
128
128
a = xp .asin (x )
129
129
ONE = one (x .shape , x .dtype )
@@ -134,7 +134,7 @@ def test_asin(x):
134
134
# mapped to nan, which is already tested in the special cases.
135
135
assert_exactly_equal (domain , codomain )
136
136
137
- @given (floating_scalars )
137
+ @given (xps . arrays ( dtype = xps . floating_dtypes (), shape = shapes ) )
138
138
def test_asinh (x ):
139
139
a = xp .asinh (x )
140
140
INFINITY = infinity (x .shape , x .dtype )
@@ -144,7 +144,7 @@ def test_asinh(x):
144
144
# mapped to nan, which is already tested in the special cases.
145
145
assert_exactly_equal (domain , codomain )
146
146
147
- @given (floating_scalars )
147
+ @given (xps . arrays ( dtype = xps . floating_dtypes (), shape = shapes ) )
148
148
def test_atan (x ):
149
149
a = xp .atan (x )
150
150
INFINITY = infinity (x .shape , x .dtype )
@@ -155,9 +155,9 @@ def test_atan(x):
155
155
# mapped to nan, which is already tested in the special cases.
156
156
assert_exactly_equal (domain , codomain )
157
157
158
- @given (two_floating_dtypes . flatmap ( lambda i : two_array_scalars ( * i ) ))
159
- def test_atan2 (args ):
160
- x1 , x2 = args
158
+ @given (two_mutual_arrays ( floating_dtype_objects ))
159
+ def test_atan2 (x1_and_x2 ):
160
+ x1 , x2 = x1_and_x2
161
161
sanity_check (x1 , x2 )
162
162
a = xp .atan2 (x1 , x2 )
163
163
INFINITY1 = infinity (x1 .shape , x1 .dtype )
@@ -192,7 +192,7 @@ def test_atan2(args):
192
192
assert_exactly_equal (logical_or (logical_and (negx1 , posx2 ),
193
193
logical_and (negx1 , negx2 )), nega )
194
194
195
- @given (floating_scalars )
195
+ @given (xps . arrays ( dtype = xps . floating_dtypes (), shape = shapes ) )
196
196
def test_atanh (x ):
197
197
a = xp .atanh (x )
198
198
ONE = one (x .shape , x .dtype )
0 commit comments