From acf85b08241e093f55b97b1aef3cd1c2d643b410 Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Sat, 6 Aug 2011 19:54:42 -0700 Subject: [PATCH] BF - allow nose with-doctest setting in environment IPDoctest replaces the normal doctest plugin. Previously we did this by initializing the builtin plugins but skipping the doctest plugin. However, if the user has a noserc file with 'with-doctest=1' or the environment variable 'NOSE_WITH_DOCTEST', then nose will try and initialize the doctest plugin when it isn't there, and barf. This commit defers the removal of the doctest plugin to the configuration stage, so doctest can be enabled before it is thrown away by us. --- IPython/testing/iptest.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index 12149c850..2dc78f7f6 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -355,19 +355,13 @@ def run_iptest(): # for nose >= 0.11, though unfortunately nose 0.10 doesn't support it. argv.append('--traverse-namespace') - # Construct list of plugins, omitting the existing doctest plugin, which - # ours replaces (and extends). + # use our plugin for doctesting. It will remove the standard doctest plugin + # if it finds it enabled plugins = [IPythonDoctest(make_exclude()), KnownFailure()] - for p in nose.plugins.builtin.plugins: - plug = p() - if plug.name == 'doctest': - continue - plugins.append(plug) - # We need a global ipython running in this process globalipapp.start_ipython() # Now nose can run - TestProgram(argv=argv, plugins=plugins) + TestProgram(argv=argv, addplugins=plugins) def run_iptestall():