Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/_pytest/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/_pytest/__pycache__/debugging.cpython-37.pyc

B

C$�X
�@s�dZddlmZddlZddlZddlZdd�Zdd�Zdd	�ZGd
d�d�Z	Gdd
�d
�Z
dd�Zdd�Zdd�Z
dd�ZdS)z6 interactive debugging with PDB, the Python Debugger. �)�absolute_importNcCs2|�d�}|jddddd�|jddd	d
d�dS)NZgeneralz--pdb�usepdb�
store_truez0start the interactive Python debugger on errors.)�dest�action�helpz--pdbcls�
usepdb_clszmodulename:classnamezqstart a custom interactive Python debugger on errors. For example: --pdbcls=IPython.terminal.debugger:TerminalPdb)r�metavarr)ZgetgroupZ
_addoption)�parser�group�r�B/opt/alt/python37/lib/python3.7/site-packages/_pytest/debugging.py�pytest_addoption	s
rcCsdt�jiS)N�	set_trace)�	pytestPDBrrrrr
�pytest_namespacesrcs�|�d�s|�d�rh|j�t�d�|�d�r\|�d��d�\}}t|�ttj||�}nt	j
}|t_t	j
tjf��fdd�}tj
t	_
|jt_|t_|j�|�dS)NrrZ	pdbinvoke�:cs�\t_t_dt_tjt_dS)N)�pdbrr�_pluginmanager�_config�Pdb�_pdb_clsr)�oldrr
�fin#szpytest_configure.<locals>.fin)�getvalue�
pluginmanager�register�	PdbInvoke�split�
__import__�getattr�sys�modulesrrrrrr�pytestr�_cleanup�append)�config�modname�	classnameZpdb_clsrr)rr
�pytest_configures
r)c@s&eZdZdZdZdZejZdd�Z	dS)rz) Pseudo PDB that defers to the real pdb. NcCs~ddl}t��j}|jdk	rl|j�d�}|r8|jdd�|j�|j	�}|�
�|�dd�|jjj
|j	d�|���|�dS)	z< invoke PDB set_trace debugging, dropping any IO capturing. rN�capturemanagerT)�in_�>z'PDB set_trace (IO-capturing turned off))r&)Z_pytest.configr!�	_getframe�f_backr�	getplugin�suspendcapturer&Zcreate_terminal_writerr�line�sep�hookZpytest_enter_pdbrr)�self�_pytest�frame�capman�twrrr
r3s

zpytestPDB.set_trace)
�__name__�
__module__�__qualname__�__doc__rrrrrrrrrr
r-s
rc@seZdZdd�Zdd�ZdS)rcCsL|jj�d�}|r:|jdd�\}}tj�|�tj�|�t||j|�dS)Nr*T)r+)	r&rr/r0r!�stdout�write�
_enter_pdb�excinfo)r4�node�call�reportr7�out�errrrr
�pytest_exception_interactCsz#PdbInvoke.pytest_exception_interactcCsFx0t|��d�D]}tj�d|�tj��qWt|�}t|�dS)N�
zINTERNALERROR> %s
)�strrr!�stderrr>�flush�_postmortem_traceback�post_mortem)r4Zexcreprr@r1�tbrrr
�pytest_internalerrorKs
zPdbInvoke.pytest_internalerrorN)r9r:r;rFrNrrrr
rBsrcCsT|jj�d�j}|��|�dd�|�|�|�dd�t|�}t|�d|_	|S)NZterminalreporterr,�	tracebackzentering PDBT)
r&rr/Z_twr1r2Z
toterminalrKrLZ	_pdbshown)rAr@�repr8rMrrr
r?Ss
r?cCs2ddlm}t|j|�r$|jjdS|jdSdS)Nr)�UnexpectedException�)ZdoctestrQ�
isinstance�value�exc_infoZ_excinfo)r@rQrrr
rKbsrKcCs>tdt|�d�}x&|r8||dj�dd�r8|d8}qW|S)Nr�Z__tracebackhide__F)�max�len�f_locals�get)�stack�irrr
�_find_last_non_hidden_framelsr]cCs0Gdd�dtj�}|�}|��|�d|�dS)Nc@seZdZdd�ZdS)zpost_mortem.<locals>.PdbcSs,tj�|||�\}}|dkr$t|�}||fS)N)rr�	get_stackr])r4�f�tr[r\rrr
r^usz"post_mortem.<locals>.Pdb.get_stackN)r9r:r;r^rrrr
rtsr)rr�resetZinteraction)r`r�prrr
rLssrL)r<�
__future__rrr!r#rrr)rrr?rKr]rLrrrr
�<module>s