Skip to content

Commit d6e919c

Browse files
committed
added tests: check presence of mpl CSS4 colors
1 parent 675415b commit d6e919c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/io/formats/test_to_excel.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
import pytest
88

9+
import pandas.util._test_decorators as td
10+
911
import pandas._testing as tm
1012

1113
from pandas.io.formats.css import CSSWarning
@@ -320,3 +322,12 @@ def tests_css_named_colors_valid():
320322
upper_hexs = set(map(str.upper, string.hexdigits))
321323
for color in CSSToExcelConverter.NAMED_COLORS.values():
322324
assert len(color) == 6 and all(c in upper_hexs for c in color)
325+
326+
327+
@td.skip_if_no_mpl
328+
def test_css_named_colors_from_mpl_present():
329+
from matplotlib.colors import CSS4_COLORS as mpl_colors
330+
331+
pd_colors = CSSToExcelConverter.NAMED_COLORS
332+
for name, color in mpl_colors.items():
333+
assert name in pd_colors and pd_colors[name] == color[1:]

0 commit comments

Comments
 (0)