Skip to content

Commit 1c1f9b4

Browse files
committed
Merge pull request #5736 from jmcnamara/bug_excel_test_cleanup
TST: Cleanup temp files in Excel test.
2 parents bac7c6e + 00af0de commit 1c1f9b4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pandas/io/tests/test_excel.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1070,12 +1070,15 @@ def test_ExcelWriter_dispatch(self):
10701070
except ImportError:
10711071
_skip_if_no_openpyxl()
10721072
writer_klass = _OpenpyxlWriter
1073-
writer = ExcelWriter('apple.xlsx')
1074-
tm.assert_isinstance(writer, writer_klass)
1073+
1074+
with ensure_clean('.xlsx') as path:
1075+
writer = ExcelWriter(path)
1076+
tm.assert_isinstance(writer, writer_klass)
10751077

10761078
_skip_if_no_xlwt()
1077-
writer = ExcelWriter('apple.xls')
1078-
tm.assert_isinstance(writer, _XlwtWriter)
1079+
with ensure_clean('.xls') as path:
1080+
writer = ExcelWriter(path)
1081+
tm.assert_isinstance(writer, _XlwtWriter)
10791082

10801083
def test_register_writer(self):
10811084
# some awkward mocking to test out dispatch and such actually works

0 commit comments

Comments
 (0)