Skip to content

Commit 5c4d0aa

Browse files
authored
CLN: remove something.xlsx (#37857)
1 parent cc78408 commit 5c4d0aa

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pandas/tests/io/excel/test_writers.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -1353,12 +1353,15 @@ def check_called(func):
13531353
del called_write_cells[:]
13541354

13551355
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"))
13621365

13631366

13641367
@td.skip_if_no("xlrd")

0 commit comments

Comments
 (0)