diff --git a/pandas/tests/copy_view/test_interp_fillna.py b/pandas/tests/copy_view/test_interp_fillna.py index 71023a538a2c3..5d4fd75df830c 100644 --- a/pandas/tests/copy_view/test_interp_fillna.py +++ b/pandas/tests/copy_view/test_interp_fillna.py @@ -248,7 +248,10 @@ def test_fillna_inplace_reference(using_copy_on_write): def test_fillna_interval_inplace_reference(using_copy_on_write): - ser = Series(interval_range(start=0, end=5), name="a") + # Set dtype explicitly to avoid implicit cast when setting nan + ser = Series( + interval_range(start=0, end=5), name="a", dtype="interval[float64, right]" + ) ser.iloc[1] = np.nan ser_orig = ser.copy()