File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1353,12 +1353,15 @@ def check_called(func):
1353
1353
del called_write_cells [:]
1354
1354
1355
1355
with pd .option_context ("io.excel.xlsx.writer" , "dummy" ):
1356
- register_writer (DummyClass )
1357
- writer = ExcelWriter ("something.xlsx" )
1358
- assert isinstance (writer , DummyClass )
1359
- df = tm .makeCustomDataframe (1 , 1 )
1360
- check_called (lambda : df .to_excel ("something.xlsx" ))
1361
- check_called (lambda : df .to_excel ("something.xls" , engine = "dummy" ))
1356
+ path = "something.xlsx"
1357
+ with tm .ensure_clean (path ) as filepath :
1358
+ register_writer (DummyClass )
1359
+ writer = ExcelWriter (filepath )
1360
+ assert isinstance (writer , DummyClass )
1361
+ df = tm .makeCustomDataframe (1 , 1 )
1362
+ check_called (lambda : df .to_excel (filepath ))
1363
+ with tm .ensure_clean ("something.xls" ) as filepath :
1364
+ check_called (lambda : df .to_excel (filepath , engine = "dummy" ))
1362
1365
1363
1366
1364
1367
@td .skip_if_no ("xlrd" )
You can’t perform that action at this time.
0 commit comments