summaryrefslogtreecommitdiff
path: root/numpy/testing/pkgtester.py
blob: 8b22955faf173c624d4dd2c79caa164b50f68993 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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