@@ -147,9 +147,9 @@ def test_arange(dtype, data):
147
147
else :
148
148
ph .assert_default_float ("arange" , out .dtype )
149
149
else :
150
- assert out .dtype == dtype
150
+ ph . assert_dtype ( "arange" , ( out .dtype ,), dtype )
151
151
assert out .ndim == 1 , f"{ out .ndim = } , but should be 1 [linspace()]"
152
- f_func = f"[arange({ start = } , { stop = } , { step = } )]"
152
+ f_func = f"[arange({ start } , { stop } , { step } )]"
153
153
# We check size is roughly as expected to avoid edge cases e.g.
154
154
#
155
155
# >>> xp.arange(2, step=0.333333333333333)
@@ -179,7 +179,7 @@ def test_arange(dtype, data):
179
179
if out .size > 0 :
180
180
assert ah .equal (
181
181
out [0 ], ah .asarray (_start , dtype = out .dtype )
182
- ), f"out[0]={ out [0 ]} , but should be { _start } [arange( { start = } , { stop = } )] "
182
+ ), f"out[0]={ out [0 ]} , but should be { _start } { f_func } "
183
183
184
184
185
185
@given (hh .shapes (), hh .kwargs (dtype = st .none () | hh .shared_dtypes ))
@@ -353,8 +353,12 @@ def test_linspace(num, dtype, endpoint, data):
353
353
)
354
354
out = xp .linspace (start , stop , num , ** kw )
355
355
356
+ if dtype is None :
357
+ ph .assert_default_float ("linspace" , out .dtype )
358
+ else :
359
+ ph .assert_dtype ("linspace" , (out .dtype ,), dtype )
356
360
ph .assert_shape ("linspace" , out .shape , num , start = stop , stop = stop , num = num )
357
- f_func = f"[linspace({ start = } , { stop = } , { num = } )]"
361
+ f_func = f"[linspace({ start } , { stop } , { num } )]"
358
362
if num > 0 :
359
363
assert ah .equal (
360
364
out [0 ], ah .asarray (start , dtype = out .dtype )
0 commit comments