-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Missed DeprecationWarning, PendingDeprecationWarning in NumPy tests #10185
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
Comments
I think the first one is being missed because we only convert warnings into
errors if they occur in numpy code, and here it's nose that's actually
making the offending call. Not sure if there's anything to be done or not;
this case is a false negative, but if we start making all warnings into
errors then that will probably trigger some false positives sooner or later.
…On Dec 9, 2017 14:07, "Charles Harris" ***@***.***> wrote:
These show up release tests, and should raise errors in development, but
they don't. We must be messing with the warnings queue somewhere.
test_nat_items (numpy.testing.tests.test_utils.TestEqual) ... /home/charris/Workspace/numpy.git/build/testenv/lib64/python2.7/site-packages/numpy/testing/nose_tools/utils.py:407: DeprecationWarning: elementwise == comparison failed; this will raise an error in the future.
if not (desired == actual):
and
numpy.core.tests.test_multiarray.TestFormat.test_1d_format ... /home/charris/Workspace/numpy.git/build/testenv/lib64/python2.7/site-packages/numpy/core/tests/test_multiarray.py:7092: PendingDeprecationWarning: object.__format__ with a non-empty format string is deprecated
return f(*args, **kwargs), None
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10185>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAlOaBKzUFW8lHNBQV_v_Lt2FCtht5lEks5s-wSPgaJpZM4Q8RRx>
.
|
But through some error handling all is good when no warning is given (didn't quite track it down yet)? The second one, I don't see right now (probably it depends on py version or so). EDIT: Sorry, no error is given. |
Ah, the |
The first one should also be caught in the |
The second one is, I think, a Python
We should probably just remove that, as testing against |
Well, I guess what causes this is the tests that compare |
Probably can just remove that test, true, though I find it a bit odd that PendingDeprecationWarning did not show up before? The tests should error on pretty much all warnings? Or maybe nobody was testing against a new enough python since then? |
Is that a python change? |
I suppose this is in
It was to allow |
@seberg In order to see them, you need to have |
I guess I decided that I didn't need to suppress the warnings, only when they were exceptions - I don't think I had a strong rationale behind that |
@eric-wieser , it is actually in |
I think the warning suppression is still needed there to deal with |
The |
Yes, the message isn't in NumPy. EDIT: Isn't in old python 2.7 either, looks like it must be a recent backport from python 3. |
@charris, @eric-wieser why do we need to convert it to AssertionError? The other tests then catches AssertionErrors. |
If we don't convert it to |
@seberg It doesn't show up because the test is constructed to succeed if the assertion fails. Kind of weird, and not designed to work with deprecations. |
@eric-wieser I think we should simply re-raise the error if |
Can't we just change this? |
Maybe, I'm going to take a look ... |
Hmm, actually this seems to be a pretty common thing to do in the meta-tests that test the assertion helpers. |
I think it already does the correct thing in release mode, the equality check goes through and a warning is issued. It is development mode where the warnings are converted to AssertionError that is the problem. |
Not that the |
@eric-wieser I put up some fixes at #10193, if you want to do more with |
These show up release tests, and should raise errors in development, but they don't. We must be messing with the warnings queue somewhere.
and
The text was updated successfully, but these errors were encountered: