diff options
author | Alan McIntyre <alan.mcintyre@local> | 2008-06-17 02:17:34 +0000 |
---|---|---|
committer | Alan McIntyre <alan.mcintyre@local> | 2008-06-17 02:17:34 +0000 |
commit | 2bdd23ef6ddabcf24ef68f08fe7a737e4b52f355 (patch) | |
tree | e2a6f8f65cd88e8cfc5420f9a52fd80ed73f4cab /numpy/testing/decorators.py | |
parent | 70974af863b99d49d9a1cf947afc019976e6b8b4 (diff) | |
download | numpy-2bdd23ef6ddabcf24ef68f08fe7a737e4b52f355.tar.gz |
Update README.txt to indicate nose version dependency, and port SciPy r4424 to NumPy
(prevent import of nose until actual execution of tests). Restored
"raises" function to numpy/testing/utils.py until it can be replaced with the function of
the same name from nose.tools after the lazy import.
Diffstat (limited to 'numpy/testing/decorators.py')
-rw-r--r-- | numpy/testing/decorators.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/testing/decorators.py b/numpy/testing/decorators.py index 6573c2a43..f74f0e573 100644 --- a/numpy/testing/decorators.py +++ b/numpy/testing/decorators.py @@ -10,11 +10,6 @@ information. """ -try: - import nose -except ImportError: - pass - def slow(t): """Labels a test as 'slow'. @@ -76,6 +71,9 @@ def skipif(skip_condition, msg=None): if msg is None: msg = 'Test skipped due to test condition' def skip_decorator(f): + # Local import to avoid a hard nose dependency and only incur the + # import time overhead at actual test-time. + import nose def skipper(*args, **kwargs): if skip_condition: raise nose.SkipTest, msg @@ -87,6 +85,9 @@ def skipif(skip_condition, msg=None): def skipknownfailure(f): ''' Decorator to raise SkipTest for test known to fail ''' + # Local import to avoid a hard nose dependency and only incur the + # import time overhead at actual test-time. + import nose def skipper(*args, **kwargs): raise nose.SkipTest, 'This test is known to fail' return nose.tools.make_decorator(f)(skipper) |