From 746d815dfa48e2cd5e99525ed00e906ad0fe3119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sat, 15 Dec 2012 20:08:18 +0100 Subject: [PATCH] Fix recursion problem with nose test suite --- skimage/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skimage/__init__.py b/skimage/__init__.py index 1435892c..daac238c 100644 --- a/skimage/__init__.py +++ b/skimage/__init__.py @@ -67,13 +67,13 @@ except ImportError: try: _imp.find_module('nose') except ImportError: - def test(verbose=False): + def _test(verbose=False): """This would invoke the skimage test suite, but nose couldn't be imported so the test suite can not run. """ raise ImportError("Could not load nose. Unit tests not available.") else: - def test(verbose=False): + def _test(verbose=False): """Invoke the skimage test suite.""" import nose args = ['', pkg_dir, '--exe'] @@ -81,6 +81,9 @@ else: args.extend(['-v', '-s']) nose.run('skimage', argv=args) +# do not use `test` as function name as this leads to a recursion problem with +# the nose test suite +test = _test test_verbose = _functools.partial(test, verbose=True) test_verbose.__doc__ = test.__doc__