XylotrechusZ
�
���g� � �2 � d Z ddlZddlmZ G d� de� Zy)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 �: � e Zd ZdZdZdZdZd� Zd� Zd� Z d� Z
d� Zy )
�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 �� � |j ddd|j dd� d�� |j ddd |j d
d� d�� |j ddd
|j dd� d�� y)z&Register commandline options.
z--pdb�
store_true� debugBoth�NOSE_PDBFz(Drop into debugger on failures or errors)�action�dest�default�helpz--pdb-failures�
debugFailures�NOSE_PDB_FAILURESzDrop into debugger on failuresz--pdb-errors�debugErrors�NOSE_PDB_ERRORSzDrop into debugger on errorsN)�
add_option�get)�self�parser�envs �A/opt/hc_python/lib/python3.12/site-packages/nose/plugins/debug.py�optionszPdb.options s� � � ����L�{��G�G�J��.�;� � =� ����\� ��G�G�/��7�1� � 3�
����<���G�G�-�u�5�/� � 1� c �� � || _ |j xs |j | _ |j xs |j | _ | j
xs | j | _ y)z<Configure which kinds of exceptions trigger plugin.
N)�confr r �enabled_for_errorsr �enabled_for_failures�enabled)r r r s r � configurez
Pdb.configure% sU � � �� �")�"5�"5�"J��9J�9J���$+�$9�$9�$N�W�=N�=N��!��0�0�K�D�4K�4K��r c �@ � | j sy| j |� y)z1Enter pdb if configured to debug errors.
N)r �debug�r �test�errs r �addErrorzPdb.addError- s � � �&�&���
�
�3�r c �@ � | j sy| j |� y)z3Enter pdb if configured to debug failures.
N)r r"