Skip to content

Backport PR #25352: TST: xfail excel styler tests, xref GH25351 #25363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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