Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Add vega deprecations to tests on master#7987
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This is a bit nicer for debugging.
with warnings.catch_warnings(record=True) as w: | ||
warnings.simplefilter('always') | ||
cmap = plt.get_cmap(name) | ||
assert len(w) == (1 if name in should_have_warning else 0) |
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.
How about adding some more data in the AssertionError message if this doesn't match? Something like
assertlen(w)== (1ifnameinshould_have_warningelse0), (name, [wg.messageforwginw])
would help the next person who wants to debug why this assertion is failing.
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.
Well,name
is already available though the parametrization and will be printed as part of the test name. Pytest also prints outw
, but unfortunately using therepr
which doesn't look that great for warnings, so maybe adding that to the message wouldn't be a bad idea.
The merge up broke this. Sorry about that.