Skip to content

Commit 07c4c43

Browse files
jrebackjorisvandenbossche
authored andcommitted
Backport PR pandas-dev#25352: TST: xfail excel styler tests, xref GH25351
1 parent 07bb3ed commit 07c4c43

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pandas/tests/io/test_excel.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,10 @@ def style(df):
24172417
['', '', '']],
24182418
index=df.index, columns=df.columns)
24192419

2420-
def assert_equal_style(cell1, cell2):
2420+
def assert_equal_style(cell1, cell2, engine):
2421+
if engine in ['xlsxwriter', 'openpyxl']:
2422+
pytest.xfail(reason=("GH25351: failing on some attribute "
2423+
"comparisons in {}".format(engine)))
24212424
# XXX: should find a better way to check equality
24222425
assert cell1.alignment.__dict__ == cell2.alignment.__dict__
24232426
assert cell1.border.__dict__ == cell2.border.__dict__
@@ -2461,7 +2464,7 @@ def custom_converter(css):
24612464
assert len(col1) == len(col2)
24622465
for cell1, cell2 in zip(col1, col2):
24632466
assert cell1.value == cell2.value
2464-
assert_equal_style(cell1, cell2)
2467+
assert_equal_style(cell1, cell2, engine)
24652468
n_cells += 1
24662469

24672470
# ensure iteration actually happened:
@@ -2519,7 +2522,7 @@ def custom_converter(css):
25192522
assert cell1.number_format == 'General'
25202523
assert cell2.number_format == '0%'
25212524
else:
2522-
assert_equal_style(cell1, cell2)
2525+
assert_equal_style(cell1, cell2, engine)
25232526

25242527
assert cell1.value == cell2.value
25252528
n_cells += 1
@@ -2537,7 +2540,7 @@ def custom_converter(css):
25372540
assert not cell1.font.bold
25382541
assert cell2.font.bold
25392542
else:
2540-
assert_equal_style(cell1, cell2)
2543+
assert_equal_style(cell1, cell2, engine)
25412544

25422545
assert cell1.value == cell2.value
25432546
n_cells += 1

0 commit comments

Comments
 (0)