Skip to content

Commit d897985

Browse files
Add test to check exception when writing in append mode
1 parent bad9a37 commit d897985

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pytest
2+
3+
import pandas._testing as tm
4+
5+
from pandas.io.excel import ExcelWriter
6+
7+
odf = pytest.importorskip("odf")
8+
9+
pytestmark = pytest.mark.parametrize("ext", [".ods"])
10+
11+
12+
def test_write_append_mode_raises(ext):
13+
msg = "Append mode is not supported with odf!"
14+
15+
with tm.ensure_clean(ext) as f:
16+
with pytest.raises(ValueError, match=msg):
17+
ExcelWriter(f, engine="odf", mode="a")

0 commit comments

Comments
 (0)