Skip to content

Commit fd4050e

Browse files
committed
Testing exception for openpyxl bug recently resolved
1 parent 2ec0914 commit fd4050e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pandas/io/excel.py

-1
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,6 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0,
15841584
else:
15851585
style = self._convert_to_style(cell.style, num_format_str)
15861586
style_dict[stylekey] = style
1587-
print(cell.row, cell.col, cell.style, style.__dict__ if style is not None else style)
15881587

15891588
if cell.mergestart is not None and cell.mergeend is not None:
15901589
wks.merge_range(startrow + cell.row,

pandas/tests/io/test_excel.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -2410,9 +2410,6 @@ def custom_converter(css):
24102410
writer, sheet_name='custom')
24112411
writer.save()
24122412

2413-
import zipfile
2414-
print(zipfile.ZipFile(path).open('xl/styles.xml').read())
2415-
24162413
if engine not in ('openpyxl', 'xlsxwriter'):
24172414
# For other engines, we only smoke test
24182415
return
@@ -2455,8 +2452,15 @@ def custom_converter(css):
24552452
assert cell1.font.color.rgb != cell2.font.color.rgb
24562453
assert cell2.font.color.rgb == alpha + '0000FF'
24572454
elif ref == 'D4':
2458-
assert cell1.font.underline != cell2.font.underline
2459-
assert cell2.font.underline == 'single'
2455+
# This fails with engine=xlsxwriter due to
2456+
# https://bitbucket.org/openpyxl/openpyxl/issues/800
2457+
if engine == 'xlsxwriter' \
2458+
and (LooseVersion(openpyxl.__version__) <
2459+
LooseVersion('2.4.6')):
2460+
pass
2461+
else:
2462+
assert cell1.font.underline != cell2.font.underline
2463+
assert cell2.font.underline == 'single'
24602464
elif ref == 'B5':
24612465
assert not cell1.border.left.style
24622466
assert (cell2.border.top.style ==

0 commit comments

Comments
 (0)