weechat-matrix icon indicating copy to clipboard operation
weechat-matrix copied to clipboard

Color test uses unsupported module method causing `make test` to fail

Open dylannorthrup opened this issue 7 months ago • 0 comments

In tests/color_test.py the webcolors.HTML4_HEX_TO_NAMES method is used to get the first 16 HTML colors. That method (and several others) were removed with a comment saying "Be absolutely clear about the mappings no longer being supported API."

In its test suite, the webcolors module retrieves the first 16 color names from w3.org. You could replicate that logic (though it would add another dependency) or copy the list of colors (which I did to "make the test work"). I'll leave the decision up to you.

For reference, this is what I changed line 23 in tests/colors_test.py to:

first_16_html_colors = ["black", "green", "silver", "lime", "gray", "olive", "white", "yellow", "maroon", "navy", "red", "blue", "purple", "teal", "fuchsia", "aqua"]

It would need adjusting to be PEP8 compliant, but was good enough for verification purposes.

dylannorthrup avatar Jul 19 '24 16:07 dylannorthrup