summaryrefslogtreecommitdiff
path: root/numpy/testing/pkgtester.py
diff options
context:
space:
mode:
authorAlan McIntyre <alan.mcintyre@local>2008-06-17 00:23:20 +0000
committerAlan McIntyre <alan.mcintyre@local>2008-06-17 00:23:20 +0000
commitc331857d8663ecf54bbe88c834755da749e8ab52 (patch)
treef4cc69ec328a5ff4d3b108f3610acb119a196493 /numpy/testing/pkgtester.py
parent22ba7886a84dc6a16ca75871f7cd2f10ef8de1f9 (diff)
downloadnumpy-c331857d8663ecf54bbe88c834755da749e8ab52.tar.gz
Switched to use nose to run tests. Added test and bench functions to all modules.
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