diff --git a/pandas/tests/io/excel/test_readers.py b/pandas/tests/io/excel/test_readers.py index 5326f2df68972..0bd2279df5529 100644 --- a/pandas/tests/io/excel/test_readers.py +++ b/pandas/tests/io/excel/test_readers.py @@ -50,13 +50,6 @@ def ignore_xlrd_time_clock_warning(): pytest.mark.filterwarnings("ignore:.*html argument"), ], ), - pytest.param( - None, - marks=[ - td.skip_if_no("xlrd"), - pytest.mark.filterwarnings("ignore:.*(tree\\.iter|html argument)"), - ], - ), pytest.param("odf", marks=td.skip_if_no("odf")), ] ) @@ -67,6 +60,22 @@ def engine(request): return request.param +@pytest.mark.filterwarnings("ignore:.*(tree\\.iter|html argument)") +@td.skip_if_no("xlrd") +def test_default_engine(datapath, monkeypatch): + monkeypatch.chdir(datapath("io", "data")) + expected = "xlrd" + + result = pd.ExcelFile("blank.xls") + assert result.engine == expected + + +def test_bad_engine_raises(): + bad_engine = "foo" + with pytest.raises(ValueError, match="Unknown engine: foo"): + pd.read_excel("", engine=bad_engine) + + class TestReaders: @pytest.fixture(autouse=True) def cd_and_set_engine(self, engine, datapath, monkeypatch, read_ext): @@ -492,11 +501,6 @@ def test_excel_read_buffer(self, read_ext): actual = pd.read_excel(f, "Sheet1", index_col=0) tm.assert_frame_equal(expected, actual) - def test_bad_engine_raises(self, read_ext): - bad_engine = "foo" - with pytest.raises(ValueError, match="Unknown engine: foo"): - pd.read_excel("", engine=bad_engine) - @tm.network def test_read_from_http_url(self, read_ext): if read_ext == ".ods": # TODO: remove once on master