Skip to content

Commit 5e8fabb

Browse files
authored
TST: Remove duplicate invalid sheet tests from io.excel (#39589)
1 parent bec736f commit 5e8fabb

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

pandas/tests/io/excel/test_odf.py

-8
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,3 @@ def test_read_writer_table():
3636
result = pd.read_excel("writertable.odt", sheet_name="Table1", index_col=0)
3737

3838
tm.assert_frame_equal(result, expected)
39-
40-
41-
def test_nonexistent_sheetname_raises(read_ext):
42-
# GH-27676
43-
# Specifying a non-existent sheet_name parameter should throw an error
44-
# with the sheet name.
45-
with pytest.raises(ValueError, match="Worksheet named 'xyz' not found"):
46-
pd.read_excel("blank.ods", sheet_name="xyz")

pandas/tests/io/excel/test_xlrd.py

-9
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,6 @@ def test_read_xlrd_book(read_ext, frame):
4040
tm.assert_frame_equal(df, result)
4141

4242

43-
# TODO: test for openpyxl as well
44-
def test_excel_table_sheet_by_index(datapath, read_ext):
45-
path = datapath("io", "data", "excel", f"test1{read_ext}")
46-
msg = "Worksheet named 'invalid_sheet_name' not found"
47-
with ExcelFile(path, engine="xlrd") as excel:
48-
with pytest.raises(ValueError, match=msg):
49-
pd.read_excel(excel, sheet_name="invalid_sheet_name")
50-
51-
5243
def test_excel_file_warning_with_xlsx_file(datapath):
5344
# GH 29375
5445
path = datapath("io", "data", "excel", "test1.xlsx")

0 commit comments

Comments
 (0)