Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib/python3.5/site-packages/nose/plugins/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/nose/plugins/__pycache__/debug.cpython-35.pyc



�~RS��@s<dZddlZddlmZGdd�de�ZdS)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@sdeZdZdZdZdZdZdd�Zdd�Zdd	�Z	d
d�Z
dd
�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
Cs�|jdddddd|jdd�d	d
�|jdddddd|jd
d�d	d�|jdddddd|jdd�d	d�dS)z&Register commandline options.
        z--pdb�action�
store_true�dest�	debugBoth�defaultZNOSE_PDBF�helpz(Drop into debugger on failures or errorsz--pdb-failures�
debugFailuresZNOSE_PDB_FAILURESzDrop into debugger on failuresz--pdb-errors�debugErrorsZNOSE_PDB_ERRORSzDrop into debugger on errorsN)�
add_option�get)�self�parser�env�r�C/opt/alt/python35/lib/python3.5/site-packages/nose/plugins/debug.py�optionsszPdb.optionscCsL||_|jp|j|_|jp-|j|_|jpB|j|_dS)z<Configure which kinds of exceptions trigger plugin.
        N)�confrr�enabled_for_errorsr�enabled_for_failures�enabled)rrrrrr�	configure%s	z
Pdb.configurecCs|js
dS|j|�dS)z1Enter pdb if configured to debug errors.
        N)r�debug)r�test�errrrr�addError-s	zPdb.addErrorcCs|js
dS|j|�dS)z3Enter pdb if configured to debug failures.
        N)rr)rrrrrr�
addFailure4s	zPdb.addFailurecCsRddl}|\}}}|j}|j|_ztj|�Wd||_XdS)Nr)�sys�stdout�
__stdout__�pdbZpost_mortem)rrrZecZev�tbr rrrr;s	z	Pdb.debugN)�__name__�
__module__�__qualname__�__doc__rr�scorerrrrrrrrrr
sr)r'r"Znose.plugins.baserrrrrr�<module>s