Skip to content

Commit 425f380

Browse files
jbrockmendelproost
authored andcommitted
CI: troubleshoot openpyxl failures (pandas-dev#30009)
1 parent b8c775a commit 425f380

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ci/deps/travis-36-cov.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ dependencies:
2727
- numexpr
2828
- numpy=1.15.*
2929
- odfpy
30-
- openpyxl
30+
- openpyxl<=3.0.1
31+
# https://github.com/pandas-dev/pandas/pull/30009 openpyxl 3.0.2 broke
3132
- pandas-gbq
3233
# https://github.com/pydata/pandas-gbq/issues/271
3334
- google-cloud-bigquery<=1.11

pandas/tests/io/excel/test_openpyxl.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
from distutils.version import LooseVersion
12
import os
23

34
import numpy as np
45
import pytest
56

7+
from pandas.compat import PY37, is_platform_mac
8+
69
import pandas as pd
710
from pandas import DataFrame
811
import pandas.util.testing as tm
@@ -13,6 +16,8 @@
1316

1417
pytestmark = pytest.mark.parametrize("ext", [".xlsx"])
1518

19+
openpyxl_gt301 = LooseVersion(openpyxl.__version__) > LooseVersion("3.0.1")
20+
1621

1722
def test_to_excel_styleconverter(ext):
1823
from openpyxl import styles
@@ -81,6 +86,9 @@ def test_write_cells_merge_styled(ext):
8186
assert xcell_a2.font == openpyxl_sty_merged
8287

8388

89+
@pytest.mark.xfail(
90+
openpyxl_gt301 and PY37 and is_platform_mac(), reason="broken change in openpyxl"
91+
)
8492
@pytest.mark.parametrize(
8593
"mode,expected", [("w", ["baz"]), ("a", ["foo", "bar", "baz"])]
8694
)
@@ -107,7 +115,9 @@ def test_write_append_mode(ext, mode, expected):
107115
assert wb2.worksheets[index]["A1"].value == cell_value
108116

109117

110-
@pytest.mark.xfail(openpyxl.__version__ > "3.0.1", reason="broken change in openpyxl")
118+
@pytest.mark.xfail(
119+
openpyxl_gt301 and PY37 and is_platform_mac(), reason="broken change in openpyxl"
120+
)
111121
def test_to_excel_with_openpyxl_engine(ext, tmpdir):
112122
# GH 29854
113123
# TODO: Fix this once newer version of openpyxl fixes the bug

0 commit comments

Comments
 (0)