@@ -117,7 +117,7 @@ def test_SparseNdarray_check(mask_rate):
117
117
contents = mock_SparseNdarray_contents (test_shape , mask_rate = mask_rate )
118
118
y = delayedarray .SparseNdarray (test_shape , contents )
119
119
assert y .shape == test_shape
120
- assert y .dtype == numpy .float64
120
+ assert y .dtype is numpy .dtype ( " float64" )
121
121
assert repr (y ).find ("SparseNdarray" ) > 0
122
122
assert delayedarray .is_sparse (y )
123
123
assert delayedarray .is_masked (y ) == (mask_rate > 0 )
@@ -172,9 +172,13 @@ def shorten(con, depth):
172
172
173
173
empty = delayedarray .SparseNdarray (test_shape , None , dtype = numpy .dtype ("int32" ), index_dtype = numpy .dtype ("int32" ))
174
174
assert empty .shape == test_shape
175
- assert empty .dtype == numpy .int32
175
+ assert empty .dtype is numpy .dtype ( " int32" )
176
176
assert not empty .is_masked
177
177
178
+ empty = delayedarray .SparseNdarray (test_shape , None , dtype = numpy .float32 , index_dtype = numpy .int32 ) # generics converted to dtypes
179
+ assert empty .dtype is numpy .dtype ("float32" )
180
+ assert empty .index_dtype is numpy .dtype ("int32" )
181
+
178
182
179
183
#######################################################
180
184
#######################################################
0 commit comments