8000 ENH,TST: Bump stacklevel and add tests for warnings by seberg · Pull Request #7148 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH,TST: Bump stacklevel and add tests for warnings #7148

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

Merged
merged 4 commits into from
Sep 2, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
DOC: Add warning stacklevel increase to the release notes
  • Loading branch information
seberg committed Sep 2, 2016
commit 68ea0c792db6bac435752e45d8681f7f1283453d
13 changes: 13 additions & 0 deletions doc/release/1.12.0-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ is regular quicksort but changing to a heapsort when not enough progress is
made. This retains the good quicksort performance while changing the worst case
runtime from ``O(N^2)`` to ``O(N*log(N))``.

stacklevel of warnings increased
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The stacklevel for python based warnings was increased so that most warnings
will report the offending line of the user code instead of the line the
warning itself is given. Passing of stacklevel is now tested to ensure that
new warnings will recieve the ``stacklevel`` argument.

This causes warnings with the "default" or "module" filter to be shown once
for every offending user code line or user module instead of only once. On
python versions before 3.4, this can cause warnings to appear that were falsly
ignored before, which may be surprising especially in test suits.


Deprecations
============

Expand Down
0