Skip to content

Commit 9e6474d

Browse files
Suppress FutureWarnings added by this change in unrelated tests
1 parent eba2ea8 commit 9e6474d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pandas/tests/io/excel/test_xlrd.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def skip_ods_and_xlsb_files(read_ext):
1919
pytest.skip("Not valid for xlrd")
2020

2121

22+
@pytest.mark.filterwarnings(
23+
"ignore:The Excel reader engine will default to:FutureWarning"
24+
)
2225
def test_read_xlrd_book(read_ext, frame):
2326
df = frame
2427

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

3942

4043
# TODO: test for openpyxl as well
44+
@pytest.mark.filterwarnings(
45+
"ignore:The Excel reader engine will default to:FutureWarning"
46+
)
4147
def test_excel_table_sheet_by_index(datapath, read_ext):
4248
path = datapath("io", "data", "excel", f"test1{read_ext}")
43-
with warnings.catch_warnings():
44-
warnings.simplefilter("ignore")
45-
with pd.ExcelFile(path) as excel:
46-
with pytest.raises(xlrd.XLRDError):
47-
pd.read_excel(excel, sheet_name="asdf")
49+
with pd.ExcelFile(path) as excel:
50+
with pytest.raises(xlrd.XLRDError):
51+
pd.read_excel(excel, sheet_name="asdf")
4852

4953

5054
# See issue #29375

0 commit comments

Comments
 (0)