summaryrefslogtreecommitdiff
path: root/numpy/testing/nosetester.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2012-04-14 20:18:20 +0200
committerRalf Gommers <ralf.gommers@googlemail.com>2012-04-14 20:18:20 +0200
commit08c20a2c23397eed0923e9ca768b4fe26c244730 (patch)
tree48014aa2bf876c0272936bb5f286ac1c43524466 /numpy/testing/nosetester.py
parent59019f1493d311c11e758b75e11653b34f7b7bad (diff)
downloadnumpy-08c20a2c23397eed0923e9ca768b4fe26c244730.tar.gz
TST: filter ImportWarnings in NoseTester.
Warnings show up when a directory with the same name as a Python file or compiled extension is seen which doesn't have an __init__.py file in it. This situation is very common, for example in SciPy where many extensions are created from source files located under a directory with the same name. This filter is located within a context manager, so only filters when running tests.
Diffstat (limited to 'numpy/testing/nosetester.py')
-rw-r--r--numpy/testing/nosetester.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py
index 847d7439a..950cb5436 100644
--- a/numpy/testing/nosetester.py
+++ b/numpy/testing/nosetester.py
@@ -360,6 +360,9 @@ class NoseTester(object):
# 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)