Skip to content

Commit b28a850

Browse files
committed
Fixed issue with xlwt install
1 parent a61badd commit b28a850

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pandas/tests/io/test_excel.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,8 @@ def test_excel_read_buffer(self, ext):
562562

563563
@td.skip_if_no('xlwt')
564564
def test_read_xlrd_Book(self, ext):
565+
import xlrd
566+
565567
df = self.frame
566568
with ensure_clean('.xls') as pth:
567569
df.to_excel(pth, "SheetA")
@@ -2025,11 +2027,10 @@ def test_write_cells_merge_styled(self):
20252027

20262028

20272029
@td.skip_if_no('xlwt')
2030+
@pytest.mark.parametrize("ext", ['.xls'])
20282031
class TestXlwtTests(SharedItems):
2029-
ext = '.xls'
2030-
engine_name = 'xlwt'
20312032

2032-
def test_excel_raise_error_on_multiindex_columns_and_no_index(self):
2033+
def test_excel_raise_error_on_multiindex_columns_and_no_index(self, ext):
20332034
_skip_if_no_xlwt()
20342035
# MultiIndex as columns is not yet implemented 9794
20352036
cols = MultiIndex.from_tuples([('site', ''),
@@ -2040,7 +2041,7 @@ def test_excel_raise_error_on_multiindex_columns_and_no_index(self):
20402041
with ensure_clean(ext) as path:
20412042
df.to_excel(path, index=False)
20422043

2043-
def test_excel_multiindex_columns_and_index_true(self):
2044+
def test_excel_multiindex_columns_and_index_true(self, ext):
20442045
_skip_if_no_xlwt()
20452046
cols = MultiIndex.from_tuples([('site', ''),
20462047
('2014', 'height'),
@@ -2049,7 +2050,7 @@ def test_excel_multiindex_columns_and_index_true(self):
20492050
with ensure_clean(ext) as path:
20502051
df.to_excel(path, index=True)
20512052

2052-
def test_excel_multiindex_index(self):
2053+
def test_excel_multiindex_index(self, ext):
20532054
_skip_if_no_xlwt()
20542055
# MultiIndex as index works so assert no error #9794
20552056
cols = MultiIndex.from_tuples([('site', ''),
@@ -2059,7 +2060,7 @@ def test_excel_multiindex_index(self):
20592060
with ensure_clean(ext) as path:
20602061
df.to_excel(path, index=False)
20612062

2062-
def test_to_excel_styleconverter(self):
2063+
def test_to_excel_styleconverter(self, ext):
20632064
_skip_if_no_xlwt()
20642065

20652066
import xlwt

0 commit comments

Comments
 (0)