From c331857d8663ecf54bbe88c834755da749e8ab52 Mon Sep 17 00:00:00 2001 From: Alan McIntyre Date: Tue, 17 Jun 2008 00:23:20 +0000 Subject: Switched to use nose to run tests. Added test and bench functions to all modules. --- numpy/testing/pkgtester.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 numpy/testing/pkgtester.py (limited to 'numpy/testing/pkgtester.py') 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 -- cgit v1.2.1