Dropping Into the Debugger

Start a pdb.post_mortem() on errors and failures.

This plugin implements testOutcome() and will drop into pdb whenever it sees a test outcome that includes exc_info.

It fires beforeInteraction() before launching pdb and afterInteraction() after. Other plugins may implement beforeInteraction() to return False and set event.handled to prevent this plugin from launching pdb.

Configuration [debugger]

always-on
Default:False
Type:boolean
errors-only
Default:False
Type:boolean

Sample configuration

The default configuration is equivalent to including the following in a unittest.cfg file.

[debugger]
always-on = False
errors-only = False

Command-line options

-D DEFAULT, --debugger DEFAULT

Enter pdb on test fail or error

Plugin class reference: Debugger

class nose2.plugins.debugger.Debugger[source]

Enter pdb on test error or failure

pdb

For ease of mocking and using different pdb implementations, pdb is aliased as a class attribute.

pdb = <module 'pdb' from '/usr/lib/python2.7/pdb.pyc'>
testOutcome(event)[source]

Drop into pdb on unexpected errors or failures