Mark tests that need openpyxl
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Mon, 21 Oct 2024 18:43:11 +0000 (19:43 +0100)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Mon, 21 Oct 2024 18:43:11 +0000 (19:43 +0100)
(These do the usual loop through engine/read_ext but
actually use .xlsx every time)

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

Gbp-Pq: Name allow_no_openpyxl.patch

pandas/tests/io/excel/test_readers.py

index 8da8535952dcf98481716a2b00863dbfe6354af5..ff29d7819996cbe4a8ea46ba91c3f55b0b9ec628 100644 (file)
@@ -1671,12 +1671,14 @@ class TestExcelFileRead:
         expected = pd.read_excel("test1" + read_ext, engine=engine)
         tm.assert_frame_equal(result, expected)
 
+    @td.skip_if_no("openpyxl")
     def test_read_excel_header_index_out_of_range(self, engine):
         # GH#43143
         with open("df_header_oob.xlsx", "rb") as f:
             with pytest.raises(ValueError, match="exceeds maximum"):
                 pd.read_excel(f, header=[0, 1])
 
+    @td.skip_if_no("openpyxl")
     @pytest.mark.parametrize("filename", ["df_empty.xlsx", "df_equals.xlsx"])
     def test_header_with_index_col(self, filename):
         # GH 33476