Skip to content

Commit

Permalink
Suppress FutureWarnings added by this change in unrelated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roberthdevries committed Jun 29, 2020
1 parent eba2ea8 commit 9e6474d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pandas/tests/io/excel/test_xlrd.py
Expand Up @@ -19,6 +19,9 @@ def skip_ods_and_xlsb_files(read_ext):
pytest.skip("Not valid for xlrd")


@pytest.mark.filterwarnings(
"ignore:The Excel reader engine will default to:FutureWarning"
)
def test_read_xlrd_book(read_ext, frame):
df = frame

Expand All @@ -38,13 +41,14 @@ def test_read_xlrd_book(read_ext, frame):


# TODO: test for openpyxl as well
@pytest.mark.filterwarnings(
"ignore:The Excel reader engine will default to:FutureWarning"
)
def test_excel_table_sheet_by_index(datapath, read_ext):
path = datapath("io", "data", "excel", f"test1{read_ext}")
with warnings.catch_warnings():
warnings.simplefilter("ignore")
with pd.ExcelFile(path) as excel:
with pytest.raises(xlrd.XLRDError):
pd.read_excel(excel, sheet_name="asdf")
with pd.ExcelFile(path) as excel:
with pytest.raises(xlrd.XLRDError):
pd.read_excel(excel, sheet_name="asdf")


# See issue #29375
Expand Down

0 comments on commit 9e6474d

Please sign in to comment.