[Numpy-svn] [numpy/numpy] fd399a: TST: do not use "ignore" to filter warnings

GitHub noreply at github.com
Fri Feb 21 17:15:33 EST 2014


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: fd399aaee5b703744f508fb2ce4718e1f4bc8984
      https://github.com/numpy/numpy/commit/fd399aaee5b703744f508fb2ce4718e1f4bc8984
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M numpy/lib/tests/test_function_base.py
    M numpy/lib/tests/test_nanfunctions.py

  Log Message:
  -----------
  TST: do not use "ignore" to filter warnings

When a warning is ignored (or raised once) in python, the warnings
module will tag on a `__warningregistry__` dictionary to be able
to filter these warnings in the future. This is tagged on to the
current context, causing leakage to later calls (this is a bit
more complex, since where the registry ends up depends on the
layers between the original caller and warner).

In short, tests should typically not use ignore but catch the
warnings to avoid changing the user experience (or errors
on duplicate test runs).

Fixes an error on duplicate test runs (does not remove all
"ignores" which may change behaviour outside tests).
Closes gh-4340


  Commit: dd857489fcaa745ea569c523249fe37537bfe280
      https://github.com/numpy/numpy/commit/dd857489fcaa745ea569c523249fe37537bfe280
  Author: Charles Harris <charlesr.harris at gmail.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M numpy/lib/tests/test_function_base.py
    M numpy/lib/tests/test_nanfunctions.py

  Log Message:
  -----------
  Merge pull request #4342 from seberg/issue-4340

TST: do not use "ignore" to filter warnings


Compare: https://github.com/numpy/numpy/compare/34d7bee3d472...dd857489fcaa


More information about the Numpy-svn mailing list