diff --git a/pandas/tests/sparse/test_array.py b/pandas/tests/sparse/test_array.py index b0a9182a265fe8..63050f6ce6feca 100644 --- a/pandas/tests/sparse/test_array.py +++ b/pandas/tests/sparse/test_array.py @@ -61,6 +61,12 @@ def test_constructor_object_dtype(self): assert arr.dtype == np.object assert arr.fill_value == 'A' + data = [False, 0, 100.0, 0.0] + arr = SparseArray(data, dtype=np.object, fill_value=False) + assert arr.dtype == np.object + assert arr.fill_value is False + assert (arr == np.array(data, dtype=np.object)).to_dense().all() + def test_constructor_spindex_dtype(self): arr = SparseArray(data=[1, 2], sparse_index=IntIndex(4, [1, 2])) tm.assert_sp_array_equal(arr, SparseArray([np.nan, 1, 2, np.nan]))