diff options
author | Alan McIntyre <alan.mcintyre@local> | 2008-07-19 13:50:16 +0000 |
---|---|---|
committer | Alan McIntyre <alan.mcintyre@local> | 2008-07-19 13:50:16 +0000 |
commit | df1fc32a47bf8450936cb436e1840132921ee90b (patch) | |
tree | 777c2b685c3eb31232c3983c9e9c0faeea8e2867 /numpy/testing/nosetester.py | |
parent | d7611a5c92dbb2be1c5edab7c3c7a8c2e9e6fa57 (diff) | |
download | numpy-df1fc32a47bf8450936cb436e1840132921ee90b.tar.gz |
Instead of importing nose plugins, use the existing list of classes that
nose.plugins.builtins imports.
If --with-doctest is included in extra_argv, remove it and use the NumPy doctester
instead.
Diffstat (limited to 'numpy/testing/nosetester.py')
-rw-r--r-- | numpy/testing/nosetester.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py index d4a98fa78..4d2cb0523 100644 --- a/numpy/testing/nosetester.py +++ b/numpy/testing/nosetester.py @@ -188,6 +188,12 @@ class NoseTester(object): label = '' doctests = True + # if doctests is in the extra args, remove it and set the doctest + # flag so the NumPy doctester is used instead + if extra_argv and '--with-doctest' in extra_argv: + extra_argv.remove('--with-doctest') + doctests = True + argv = self._test_argv(label, verbose, extra_argv) if doctests: argv += ['--with-numpydoctest'] @@ -231,14 +237,17 @@ class NoseTester(object): # reset doctest state on every run import doctest doctest.master = None - - import nose.plugins.builtin + + # construct list of plugins, omitting the existing doctest plugin + import nose.plugins.builtin from noseclasses import numpyDoctest - plugins = [numpyDoctest(), ] - for m, p in nose.plugins.builtin.builtins: - mod = __import__(m,globals(),{},[p]) - plug = getattr(mod, p) - plugins.append(plug()) + plugins = [numpyDoctest()] + for p in nose.plugins.builtin.plugins: + plug = p() + if plug.name == 'doctest': + continue + + plugins.append(plug) t = NumpyTestProgram(argv=argv, exit=False, plugins=plugins) return t.result |