Skip to content

TST: Remove duplicate invalid sheet tests from io.excel #39589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions pandas/tests/io/excel/test_odf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,3 @@ def test_read_writer_table():
result = pd.read_excel("writertable.odt", sheet_name="Table1", index_col=0)

tm.assert_frame_equal(result, expected)


def test_nonexistent_sheetname_raises(read_ext):
# GH-27676
# Specifying a non-existent sheet_name parameter should throw an error
# with the sheet name.
with pytest.raises(ValueError, match="Worksheet named 'xyz' not found"):
pd.read_excel("blank.ods", sheet_name="xyz")
9 changes: 0 additions & 9 deletions pandas/tests/io/excel/test_xlrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ def test_read_xlrd_book(read_ext, frame):
tm.assert_frame_equal(df, result)


# TODO: test for openpyxl as well
def test_excel_table_sheet_by_index(datapath, read_ext):
path = datapath("io", "data", "excel", f"test1{read_ext}")
msg = "Worksheet named 'invalid_sheet_name' not found"
with ExcelFile(path, engine="xlrd") as excel:
with pytest.raises(ValueError, match=msg):
pd.read_excel(excel, sheet_name="invalid_sheet_name")


def test_excel_file_warning_with_xlsx_file(datapath):
# GH 29375
path = datapath("io", "data", "excel", "test1.xlsx")
Expand Down