@@ -709,7 +709,7 @@ def test_excel_date_datetime_format(self, ext, path):
709709 # we need to use df_expected to check the result.
710710 tm .assert_frame_equal (rs2 , df_expected )
711711
712- def test_to_excel_interval_no_labels (self , path ):
712+ def test_to_excel_interval_no_labels (self , path , using_infer_string ):
713713 # see gh-19242
714714 #
715715 # Test writing Interval without labels.
@@ -719,7 +719,9 @@ def test_to_excel_interval_no_labels(self, path):
719719 expected = df .copy ()
720720
721721 df ["new" ] = pd .cut (df [0 ], 10 )
722- expected ["new" ] = pd .cut (expected [0 ], 10 ).astype (str )
722+ expected ["new" ] = pd .cut (expected [0 ], 10 ).astype (
723+ str if not using_infer_string else "string[pyarrow_numpy]"
724+ )
723725
724726 df .to_excel (path , sheet_name = "test1" )
725727 with ExcelFile (path ) as reader :
@@ -1213,10 +1215,9 @@ def test_render_as_column_name(self, path):
12131215
12141216 def test_true_and_false_value_options (self , path ):
12151217 # see gh-13347
1216- df = DataFrame ([["foo" , "bar" ]], columns = ["col1" , "col2" ])
1217- msg = "Downcasting behavior in `replace`"
1218- with tm .assert_produces_warning (FutureWarning , match = msg ):
1219- expected = df .replace ({"foo" : True , "bar" : False })
1218+ df = DataFrame ([["foo" , "bar" ]], columns = ["col1" , "col2" ], dtype = object )
1219+ with option_context ("future.no_silent_downcasting" , True ):
1220+ expected = df .replace ({"foo" : True , "bar" : False }).astype ("bool" )
12201221
12211222 df .to_excel (path )
12221223 read_frame = pd .read_excel (
0 commit comments