@@ -206,7 +206,7 @@ def test_device(self, xp: ModuleType, device: Device):
206
206
@given (
207
207
n_arrays = st .integers (min_value = 1 , max_value = 3 ),
208
208
rng_seed = st .integers (min_value = 1000000000 , max_value = 9999999999 ),
209
- dtype = st . sampled_from (( np . float32 , np . float64 )),
209
+ dtype = npst . floating_dtypes ( sizes = ( 32 , 64 )),
210
210
p = st .floats (min_value = 0 , max_value = 1 ),
211
211
data = st .data (),
212
212
)
@@ -223,7 +223,7 @@ def test_hypothesis(
223
223
if (
224
224
library .like (Backend .NUMPY )
225
225
and NUMPY_VERSION < (2 , 0 )
226
- and dtype is np .float32
226
+ and dtype . type is np .float32
227
227
):
228
228
pytest .xfail (reason = "NumPy 1.x dtype promotion for scalars" )
229
229
@@ -236,17 +236,17 @@ def test_hypothesis(
236
236
elements = {"allow_subnormal" : not library .like (Backend .CUPY , Backend .JAX )}
237
237
238
238
fill_value = xp .asarray (
239
- data .draw (npst .arrays (dtype = dtype , shape = (), elements = elements ))
239
+ data .draw (npst .arrays (dtype = dtype . type , shape = (), elements = elements ))
240
240
)
241
241
float_fill_value = float (fill_value )
242
- if library is Backend .CUPY and dtype is np .float32 :
242
+ if library is Backend .CUPY and dtype . type is np .float32 :
243
243
# Avoid data-dependent dtype promotion when encountering subnormals
244
244
# close to the max float32 value
245
245
float_fill_value = float (np .clip (float_fill_value , - 1e38 , 1e38 ))
246
246
247
247
arrays = tuple (
248
248
xp .asarray (
249
- data .draw (npst .arrays (dtype = dtype , shape = shape , elements = elements ))
249
+ data .draw (npst .arrays (dtype = dtype . type , shape = shape , elements = elements ))
250
250
)
251
251
for shape in shapes
252
252
)
0 commit comments