From 08c20a2c23397eed0923e9ca768b4fe26c244730 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Sat, 14 Apr 2012 20:18:20 +0200 Subject: 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. --- numpy/testing/nosetester.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'numpy/testing') 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) -- cgit v1.2.1