| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import copy | ||
| import itertools | ||
| import unittest.mock | ||
| from re import escape | ||
|
|
||
| from io import BytesIO | ||
| import numpy as np | ||
| Expand Down Expand Up | @@ -1592,3 +1593,20 @@ def test_cm_set_cmap_error(): | |
| bad_cmap = 'AardvarksAreAwkward' | ||
| with pytest.raises(ValueError, match=bad_cmap): | ||
| sm.set_cmap(bad_cmap) | ||
|
|
||
|
|
||
| def test_check_color_like(): | ||
| err_msg = "['abcd'] is not a valid value for c" | ||
| assert mcolors._check_color_like(colors1='yellow', colors2='red') is None | ||
| with pytest.raises(ValueError, match=err_msg): | ||
| mcolors._check_color_like(c='abcd') | ||
|
|
||
|
|
||
| def test_check_color_like_list(): | ||
| err_msg = escape("['abcd'] are not valid values for c") | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYou should be able to use r" instead of escape but if using escape then please write re.escape and import re rather than from re import escape
Sorry, something went wrong.
All reactions
|
||
| assert mcolors._check_color_like_list(colors=['yellow', 'orange']) is None | ||
| assert mcolors._check_color_like_list(c1=['red'], c2=['blue']) is None | ||
| with pytest.raises(ValueError, match=err_msg): | ||
| mcolors._check_color_like_list(c=['abcd', 'red']) | ||
| with pytest.raises(ValueError, match=err_msg): | ||
| mcolors._check_color_like_list(c1=['red', 'blue'], c=['abcd']) | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI'm pretty sure this error message isn't a list because the input to this function isn't a list
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.