summaryrefslogtreecommitdiff
path: root/numpy/testing/pkgtester.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/testing/pkgtester.py')
-rw-r--r--numpy/testing/pkgtester.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/numpy/testing/pkgtester.py b/numpy/testing/pkgtester.py
new file mode 100644
index 000000000..8b22955fa
--- /dev/null
+++ b/numpy/testing/pkgtester.py
@@ -0,0 +1,27 @@
+''' Define test function for scipy package
+
+Module tests for presence of useful version of nose. If present
+returns NoseTester, otherwise returns a placeholder test routine
+reporting lack of nose and inability to run tests. Typical use is in
+module __init__:
+
+from scipy.testing.pkgtester import Tester
+test = Tester().test
+
+See nosetester module for test implementation
+
+'''
+fine_nose = True
+try:
+ import nose
+except ImportError:
+ fine_nose = False
+else:
+ nose_version = nose.__versioninfo__
+ if nose_version[0] < 1 and nose_version[1] < 10:
+ fine_nose = False
+
+if fine_nose:
+ from numpy.testing.nosetester import NoseTester as Tester
+else:
+ from numpy.testing.nulltester import NullTester as Tester