Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

BF - allow nose with-doctest setting in environment #683

Closed
wants to merge 1 commit into from

2 participants

Matthew Brett Fernando Perez
Matthew Brett

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.

Matthew Brett matthew-brett 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.
718b2d2
Fernando Perez
Owner

Great, thanks! Pushed (with a rebase to avoid the merge handle for a single commit.)

Fernando Perez fperez closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 7, 2011
  1. Matthew Brett

    BF - allow nose with-doctest setting in environment

    matthew-brett authored
    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.
This page is out of date. Refresh to see the latest.
12 IPython/testing/iptest.py
View
@@ -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():
6 IPython/testing/plugin/ipdoctest.py
View
@@ -640,6 +640,9 @@ def options(self, parser, env=os.environ):
def configure(self, options, config):
Plugin.configure(self, options, config)
+ # Pull standard doctest plugin out of config; we will do doctesting
+ config.plugins.plugins = [p for p in config.plugins.plugins
+ if p.name != 'doctest']
self.doctest_tests = options.doctest_tests
self.extension = tolist(options.doctestExtension)
@@ -783,6 +786,9 @@ def options(self, parser, env=os.environ):
def configure(self, options, config):
#print "Configuring nose plugin:", self.name # dbg
Plugin.configure(self, options, config)
+ # Pull standard doctest plugin out of config; we will do doctesting
+ config.plugins.plugins = [p for p in config.plugins.plugins
+ if p.name != 'doctest']
self.doctest_tests = options.ipdoctest_tests
self.extension = tolist(options.ipdoctest_extension)
Something went wrong with that request. Please try again.