1
+ import math
2
+
1
3
from ._array_module import (asarray , arange , ceil , empty , empty_like , eye , full ,
2
4
full_like , equal , all , linspace , ones , ones_like ,
3
5
zeros , zeros_like , isnan )
@@ -157,7 +159,7 @@ def test_full(shape, fill_value, kw):
157
159
else :
158
160
assert out .dtype == dtype
159
161
assert out .shape == shape , f"{ shape = } , but full() returned an array with shape { out .shape } "
160
- if is_float_dtype (out .dtype ) and isnan (asarray ( fill_value ) ):
162
+ if is_float_dtype (out .dtype ) and math . isnan (fill_value ):
161
163
assert all (isnan (out )), "full() array did not equal the fill value"
162
164
else :
163
165
assert all (equal (out , asarray (fill_value , dtype = dtype ))), "full() array did not equal the fill value"
@@ -183,7 +185,7 @@ def test_full_like(x, fill_value, kw):
183
185
else :
184
186
assert out .dtype == dtype , f"{ dtype = !s} , but full_like() returned an array with dtype { out .dtype } "
185
187
assert out .shape == x .shape , "{x.shape=}, but full_like() returned an array with shape {out.shape}"
186
- if is_float_dtype (dtype ) and isnan (asarray ( fill_value ) ):
188
+ if is_float_dtype (dtype ) and math . isnan (fill_value ):
187
189
assert all (isnan (out )), "full_like() array did not equal the fill value"
188
190
else :
189
191
assert all (equal (out , asarray (fill_value , dtype = dtype ))), "full_like() array did not equal the fill value"
0 commit comments