ó J9•Qc@s<dZddlZddlmZdefd„ƒYZdS(sĘ 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``. i˙˙˙˙N(tPlugintPdbcBsMeZdZeZeZdZd„Zd„Zd„Z d„Z d„Z RS(s— Provides --pdb and --pdb-failures options that cause the test runner to drop into pdb if it encounters an error or failure, respectively. ic Csf|jdddddd|jdtƒdd ƒ|jd dddd d|jd tƒdd ƒdS(s&Register commandline options. s--pdbtactiont store_truetdestt debugErrorstdefaulttNOSE_PDBthelpsDrop into debugger on errorss--pdb-failurest debugFailurestNOSE_PDB_FAILURESsDrop into debugger on failuresN(t add_optiontgettFalse(tselftparsertenv((s6/sys/lib/python2.7/site-packages/nose/plugins/debug.pytoptionss cCs:||_|jp|j|_|j|_|j|_dS(s<Configure which kinds of exceptions trigger plugin. N(tconfRR tenabledtenabled_for_errorstenabled_for_failures(RRR((s6/sys/lib/python2.7/site-packages/nose/plugins/debug.pyt configure s  cCs|js dS|j|ƒdS(s1Enter pdb if configured to debug errors. N(Rtdebug(Rttestterr((s6/sys/lib/python2.7/site-packages/nose/plugins/debug.pytaddError(s cCs|js dS|j|ƒdS(s3Enter pdb if configured to debug failures. N(RR(RRR((s6/sys/lib/python2.7/site-packages/nose/plugins/debug.pyt addFailure/s cCsRddl}|\}}}|j}|j|_ztj|ƒWd||_XdS(Ni˙˙˙˙(tsyststdoutt __stdout__tpdbt post_mortem(RRRtectevttbR((s6/sys/lib/python2.7/site-packages/nose/plugins/debug.pyR6s   ( t__name__t __module__t__doc__R RRtscoreRRRRR(((s6/sys/lib/python2.7/site-packages/nose/plugins/debug.pyR s   (R&Rtnose.plugins.baseRR(((s6/sys/lib/python2.7/site-packages/nose/plugins/debug.pyts