Skip to content

Commit

Permalink
Backport PR pandas-dev#25352: TST: xfail excel styler tests, xref GH2…
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche authored Feb 19, 2019
1 parent 07bb3ed commit 82a4949
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pandas/tests/io/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2417,7 +2417,10 @@ def style(df):
['', '', '']],
index=df.index, columns=df.columns)

def assert_equal_style(cell1, cell2):
def assert_equal_style(cell1, cell2, engine):
if engine in ['xlsxwriter', 'openpyxl']:
pytest.xfail(reason=("GH25351: failing on some attribute "
"comparisons in {}".format(engine)))
# XXX: should find a better way to check equality
assert cell1.alignment.__dict__ == cell2.alignment.__dict__
assert cell1.border.__dict__ == cell2.border.__dict__
Expand Down Expand Up @@ -2461,7 +2464,7 @@ def custom_converter(css):
assert len(col1) == len(col2)
for cell1, cell2 in zip(col1, col2):
assert cell1.value == cell2.value
assert_equal_style(cell1, cell2)
assert_equal_style(cell1, cell2, engine)
n_cells += 1

# ensure iteration actually happened:
Expand Down Expand Up @@ -2519,7 +2522,7 @@ def custom_converter(css):
assert cell1.number_format == 'General'
assert cell2.number_format == '0%'
else:
assert_equal_style(cell1, cell2)
assert_equal_style(cell1, cell2, engine)

assert cell1.value == cell2.value
n_cells += 1
Expand All @@ -2537,7 +2540,7 @@ def custom_converter(css):
assert not cell1.font.bold
assert cell2.font.bold
else:
assert_equal_style(cell1, cell2)
assert_equal_style(cell1, cell2, engine)

assert cell1.value == cell2.value
n_cells += 1
Expand Down

0 comments on commit 82a4949

Please sign in to comment.