Skip to content

Commit 05bbd54

Browse files
committed
TST: Fix wrong array comparison in the make_sparse bug-fix test
1 parent ac2bd84 commit 05bbd54

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/tests/sparse/test_array.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def test_constructor_object_dtype(self):
6666
arr = SparseArray(data, dtype=np.object, fill_value=False)
6767
assert arr.dtype == np.object
6868
assert arr.fill_value is False
69-
assert (arr == np.array(data, dtype=np.object)).to_dense().all()
69+
arr_expected = np.array(data, dtype=np.object)
70+
it = (type(x) == type(y) and x == y for x, y in zip(arr, arr_expected))
71+
assert np.fromiter(it, dtype=np.bool).all()
7072

7173
def test_constructor_spindex_dtype(self):
7274
arr = SparseArray(data=[1, 2], sparse_index=IntIndex(4, [1, 2]))

0 commit comments

Comments
 (0)