-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: Doctest doesn't have a SHOW_WARNINGS directive. #23819
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -154,7 +154,7 @@ def geterr(): | |||
-------- | |||
>>> np.geterr() | |||
{'divide': 'warn', 'over': 'warn', 'under': 'ignore', 'invalid': 'warn'} | |||
>>> np.arange(3.) / np.arange(3.) # doctest: +SHOW_WARNINGS |
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.
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.
@bsipocz Hmm, removing that fails differently on the refguide checks. I think the best short term fix is to skip that test. Could you make sure to add it back in your PR?
@@ -154,7 +154,7 @@ def geterr(): | |||
-------- | |||
>>> np.geterr() | |||
{'divide': 'warn', 'over': 'warn', 'under': 'ignore', 'invalid': 'warn'} | |||
>>> np.arange(3.) / np.arange(3.) # doctest: +SHOW_WARNINGS | |||
>>> np.arange(3.) / np.arange(3.) | |||
array([nan, 1., 1.]) | |||
RuntimeWarning: invalid value encountered in divide |
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.
I believe the exception needs to be removed here in here.
RuntimeWarning: invalid value encountered in divide |
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.
I think the warning is correct, but maybe warnings are set up differently in the two runs. With pytest, we have the problem that warnings are set to errors (when they should probably not be for the doctest part), and maybe the current checks don't handle them at all?
In any case, I tend towards the +SKIP. If we forget about it... this function should maybe be hidden away from public anyway...
acd6d02
to
37e14b7
Compare
Not sure that SKIP is ideal, but I do think the warning should be in the docs (it would show the warning in a normal setup there), so SKIP is hopefully OK for now and unblocks CI. Thanks for fixing this up Chuck! |
No description provided.