summaryrefslogtreecommitdiff
path: root/numpy/testing/nosetester.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2012-04-15 14:04:53 -0700
committerRalf Gommers <ralf.gommers@googlemail.com>2012-04-15 14:04:53 -0700
commitdafb2dd0ea89821fe9c90c42e218869cc2025e9f (patch)
treecd605b59b865ea1993051afb718de29957cfcdc4 /numpy/testing/nosetester.py
parent4872caccb9a4f5d11e46072159f282337e09c70e (diff)
parentb86dc69d1b1d2a63998512b9acaedf71cabd732a (diff)
downloadnumpy-dafb2dd0ea89821fe9c90c42e218869cc2025e9f.tar.gz
Merge pull request #253 from charris/fix-filter-importwarnings
Fix filter importwarnings This PR fixes the issue left over from merging PR-251.
Diffstat (limited to 'numpy/testing/nosetester.py')
-rw-r--r--numpy/testing/nosetester.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py
index 950cb5436..024c6e25f 100644
--- a/numpy/testing/nosetester.py
+++ b/numpy/testing/nosetester.py
@@ -353,23 +353,23 @@ class NoseTester(object):
# Preserve the state of the warning filters
warn_ctx = numpy.testing.utils.WarningManager()
warn_ctx.__enter__()
+ # Reset the warning filters to the default state,
+ # so that running the tests is more repeatable.
+ warnings.resetwarnings()
+ # If deprecation warnings are not set to 'error' below,
+ # at least set them to 'warn'.
+ warnings.filterwarnings('always', category=DeprecationWarning)
+ # Force the requested warnings to raise
+ for warningtype in raise_warnings:
+ warnings.filterwarnings('error', category=warningtype)
+ # Filter out annoying import messages.
+ warnings.filterwarnings('ignore', message='Not importing directory')
+
try:
- # Reset the warning filters to the default state,
- # so that running the tests is more repeatable.
- warnings.resetwarnings()
- # If deprecation warnings are not set to 'error' below,
- # at least set them to 'warn'.
- warnings.filterwarnings('always', category=DeprecationWarning)
- warnings.filterwarnings('ignore',
- message='Not importing directory',
- category=ImportWarning)
- # Force the requested warnings to raise
- for warningtype in raise_warnings:
- warnings.filterwarnings('error', category=warningtype)
-
- argv, plugins = self.prepare_test_args(label, verbose, extra_argv,
- doctests, coverage)
from noseclasses import NumpyTestProgram
+
+ argv, plugins = self.prepare_test_args(label,
+ verbose, extra_argv, doctests, coverage)
t = NumpyTestProgram(argv=argv, exit=False, plugins=plugins)
finally:
warn_ctx.__exit__()