Skip to content

Commit 68579bf

Browse files
committed
FIX: Ensure nan is cast to currently tested dtype
1 parent 5804c56 commit 68579bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nibabel/tests/test_volumeutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def test_a2f_nan2zero_range():
678678
with pytest.raises(ValueError):
679679
write_return(arr_no_nan, fobj, np.int8, intercept=129)
680680
# OK with nan2zero false, but we get whatever nan casts to
681-
nan_cast = np.array(np.nan).astype(np.int8)
681+
nan_cast = np.array(np.nan, dtype=dt).astype(np.int8)
682682
back_arr = write_return(arr, fobj, np.int8, intercept=129, nan2zero=False)
683683
assert_array_equal([-128, -128, -128, nan_cast], back_arr)
684684
# divslope

0 commit comments

Comments
 (0)