B
~RS @ s, d Z ddlZddlmZ G dd deZdS )z
This plugin provides ``--pdb`` and ``--pdb-failures`` options. The ``--pdb``
option will drop the test runner into pdb when it encounters an error. To
drop into pdb on failure, use ``--pdb-failures``.
N)Pluginc @ sD e Zd ZdZdZdZdZdd Zdd Zdd Z d
d Z
dd
ZdS )Pdbz
Provides --pdb and --pdb-failures options that cause the test runner to
drop into pdb if it encounters an error or failure, respectively.
F c C sX |j ddd|dddd |j ddd |d
ddd |j ddd
|dddd dS )z&Register commandline options.
z--pdb
store_true debugBothZNOSE_PDBFz(Drop into debugger on failures or errors)actiondestdefaulthelpz--pdb-failures
debugFailuresZNOSE_PDB_FAILURESzDrop into debugger on failuresz--pdb-errorsdebugErrorsZNOSE_PDB_ERRORSzDrop into debugger on errorsN)Z
add_optionget)selfparserenv r C/opt/alt/python37/lib/python3.7/site-packages/nose/plugins/debug.pyoptions s
zPdb.optionsc C s4 || _ |jp|j| _|jp|j| _| jp,| j| _dS )z<Configure which kinds of exceptions trigger plugin.
N)confr r enabled_for_errorsr enabled_for_failuresZenabled)r r r r r r configure% s z
Pdb.configurec C s | j s
dS | | dS )z1Enter pdb if configured to debug errors.
N)r debug)r testerrr r r addError- s zPdb.addErrorc C s | j s
dS | | dS )z3Enter pdb if configured to debug failures.
N)r r )r r r r r r
addFailure4 s zPdb.addFailurec C s<