403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/_pytest/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/_pytest/__pycache__/debugging.cpython-39.pyc
a

05d�4�@s�dZddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z e�r.ddl!m"Z"ddl#m$Z$e%ee%e%fd�dd�Z&edd�dd�Z'edd�dd �Z(Gd!d"�d"�Z)Gd#d$�d$�Z*Gd%d&�d&�Z+d'd(�Z,d)d*�Z-eee.e e d+�d,d-�Z/ee.ej0d.�d/d0�Z1ej0dd1�d2d3�Z2dS)4z4Interactive debugging with PDB, the Python Debugger.�N)�Any)�Callable)�	Generator)�List)�Optional)�Tuple)�Type)�
TYPE_CHECKING)�Union)�outcomes)�
ExceptionInfo)�Config)�ConftestImportFailure)�hookimpl)�PytestPluginManager)�Parser)�
UsageError)�Node)�
BaseReport)�CaptureManager)�CallInfo)�value�returnc
CsRz|�d�\}}Wn6tyH}zt�|�d��|�WYd}~n
d}~00||fS)z#Validate syntax of --pdbcls option.�:z) is not in the format 'modname:classname'N)�split�
ValueError�argparse�ArgumentTypeError)r�modname�	classname�e�r!�5/usr/lib/python3.9/site-packages/_pytest/debugging.py�_validate_usepdb_cls!s��r#)�parserrcCsF|�d�}|jddddd�|jddd	td
d�|jdd
ddd�dS)NZgeneralz--pdb�usepdb�
store_truezDStart the interactive Python debugger on errors or KeyboardInterrupt)�dest�action�helpz--pdbcls�
usepdb_clszmodulename:classnamez{Specify a custom interactive Python debugger for use with --pdb.For example: --pdbcls=IPython.terminal.debugger:TerminalPdb)r'�metavar�typer)z--trace�tracez(Immediately break when running each test)ZgetgroupZ
_addoptionr#)r$�groupr!r!r"�pytest_addoption,s(
���r/)�configrcs�ddl�|�d�r"|j�t�d�|�d�r<|j�t�d�tj��j	tj
tjf�tj	�_	|jt_
|t_dd��fdd�}|�|�dS)	Nrr-Zpdbtracer%Z	pdbinvoke�rcstj��\�_t_t_dS�N)�	pytestPDB�_saved�pop�	set_trace�_pluginmanager�_configr!��pdbr!r"�finUs��zpytest_configure.<locals>.fin)
r:�getvalue�
pluginmanager�register�PdbTrace�	PdbInvoker3r4�appendr6r7r8Zadd_cleanup)r0r;r!r9r"�pytest_configureDs

�rBc@s�eZdZUdZdZeeed<dZee	ed<gZ
eee
deeee	fed<dZdZeeeeeefed<eed	eeefd
�dd��Zeed	d
�dd��Zeed	d
�dd��Zedd��Zedd�dd��ZdS)r3z'Pseudo PDB that defers to the real pdb.Nr7r8).Nr4r�_wrapped_pdb_clsr)�capmanrcCs|r|��SdS)NF)Zis_capturing)�clsrDr!r!r"�
_is_capturingjszpytestPDB._is_capturing)rDc

Cs|jsddl}|jS|j�d�}|jr>|jd|kr>|jdS|r�|\}}zJt|�tj|}|�d�}t	||d�}|dd�D]}	t	||	�}q�Wq�t
y�}
z0d�||f�}td|�d|
���|
�WYd}
~
q�d}
~
00nddl}|j}|�
||�}||f|_|S)Nrr*��.rz--pdbcls: could not import z: )r8r:ZPdbr<rC�
__import__�sys�modulesr�getattr�	Exception�joinr�_get_pdb_wrapper_class)
rErDr:r*rr�mod�parts�pdb_cls�part�excrZwrapped_clsr!r!r"�_import_pdb_clsps6


��
zpytestPDB._import_pdb_clscs$ddl�G���fdd�d|�}|S)NrcsleZdZ�ZdZ��fdd�Z���fdd�ZeZZ��fdd�Z	e	Z
e	Z�fdd	�Z�fd
d�Z
�ZS)z:pytestPDB._get_pdb_wrapper_class.<locals>.PytestPdbWrapperFcs,�jd7_t��|�}�jd8_|S)NrG)�_recursive_debug�super�do_debug��self�arg�ret��	__class__rEr!r"rX�szCpytestPDB._get_pdb_wrapper_class.<locals>.PytestPdbWrapper.do_debugcs�t��|�}�jdkr��jdus$J��j��j�}|��|j}t�	|�}|r�|dkrd|�
dd�n|�
dd|�|dus�J�|��n|�
dd��jdus�J��jj
j�j|d�d|_|S)	Nr�global�>z#PDB continue (IO-capturing resumed)z*PDB continue (IO-capturing resumed for %s)zPDB continue�r0r:T)rW�do_continuerVr8r0�create_terminal_writer�line�_pytest_capmanr3rF�sepZresumer7�hookZpytest_leave_pdb�
_continued)rZr[r\�twrD�	capturing)r^�_pytestrEr!r"rb�s.

��
zFpytestPDB._get_pdb_wrapper_class.<locals>.PytestPdbWrapper.do_continuecs$t��|�}�jdkr t�d�|S)aRaise Exit outcome when quit command is used in pdb.

                This is a bit of a hack - it would be better if BdbQuit
                could be handled, but this would require to wrap the
                whole pytest run, and adjust the report etc.
                r�Quitting debugger)rW�do_quitrVr�exitrYr]r!r"rm�s

zBpytestPDB._get_pdb_wrapper_class.<locals>.PytestPdbWrapper.do_quitcs0t��||�}|s,|jr,|jr,|jjdd�|S)z�Suspend on setup().

                Needed after do_continue resumed, and entering another
                breakpoint again.
                T�Zin_)rW�setuprhre�suspend_global_capture)rZ�f�tbr\�r^r!r"rp�s

z@pytestPDB._get_pdb_wrapper_class.<locals>.PytestPdbWrapper.setupcsXt��||�\}}|durPtdt|�d�}|rP||dj�dd�rP|d8}q,||fS)NrrGZ__tracebackhide__F)rW�	get_stack�max�len�f_locals�get)rZrr�t�stack�irtr!r"ru�s
zDpytestPDB._get_pdb_wrapper_class.<locals>.PytestPdbWrapper.get_stack)�__name__�
__module__�__qualname__rerhrXrbZdo_cZdo_contrmZdo_qZdo_exitrpru�
__classcell__r!�rkrDrErtr"�PytestPdbWrapper�sr�)�_pytest.config)rErRrDr�r!r�r"rO�sOz pytestPDB._get_pdb_wrapper_classc
Osddl}|jdurd}n|j�d�}|r4|jdd�|jr�|j�|j�}|��|jdkr�|�	dd�}|dur||�
d|�nT|�|�}|dkr�|�
dd	|�d
��n,|r�|�
dd||f�n|�
dd	|���|�|�fi|��}	|jr�|jj
j|j|	d�|	S)
z4Initialize PDB debugging, dropping any IO capturing.rN�capturemanagerTro�headerr`r_zPDB z (IO-capturing turned off)z'PDB %s (IO-capturing turned off for %s)ra)r�r7�	getpluginZsuspendr8r0rcrdrVr5rfrFrUrgZpytest_enter_pdb)
rE�method�args�kwargsrkrDrir�rj�_pdbr!r!r"�	_init_pdb�s8


��zpytestPDB._init_pdbr1cOs0t��j}|jdg|�Ri|��}|�|�dS)zBInvoke debugging via ``Pdb.set_trace``, dropping any IO capturing.r6N)rJ�	_getframe�f_backr�r6)rEr�r��framer�r!r!r"r6s
zpytestPDB.set_trace)r}r~r�__doc__r7rr�__annotations__r8r
r4rrrrVrCrr�classmethodr
�str�boolrFrUrOr�r6r!r!r!r"r3_s&
�� &V
'r3c@s4eZdZededd�dd�Zeedd�dd�ZdS)	r@z
CallInfo[Any]N)�node�call�reportrcCsr|jj�d�}|rB|jdd�|��\}}tj�|�tj�|�|jdusPJ�t	|jj
tj�snt
||j|�dS)Nr�Tro)r0r=r�rqZread_global_capturerJ�stdout�write�excinfo�
isinstancer�unittestZSkipTest�
_enter_pdb)rZr�r�r�rD�out�errr!r!r"�pytest_exception_interactsz#PdbInvoke.pytest_exception_interact�r�rcCst|�}t|�dSr2)�_postmortem_traceback�post_mortem)rZr�rsr!r!r"�pytest_internalerror-szPdbInvoke.pytest_internalerror)	r}r~rrrr�r�
BaseExceptionr�r!r!r!r"r@s�r@c@s(eZdZedd�edd�dd��ZdS)r?T)Zhookwrapper)NNNr1ccst|�dVdSr2)� wrap_pytest_function_for_tracing)rZ�
pyfuncitemr!r!r"�pytest_pyfunc_call3szPdbTrace.pytest_pyfunc_callN)r}r~rrrr�r!r!r!r"r?2sr?cs2t�d��|j�t�����fdd��}||_dS)z�Change the Python function object of the given Function item by a
    wrapper which actually enters pdb before calling the python function
    itself, effectively leaving the user in the pdb prompt in the first
    statement of the function.�runcallcs&tj�g|�Ri|��}��|�dSr2)�	functools�partialr�)r�r��func�r�Ztestfunctionr!r"�wrapperDsz1wrap_pytest_function_for_tracing.<locals>.wrapperN)r3r��objr��wraps)r�r�r!r�r"r�9s

r�cCs|j�d�rt|�dS)zaWrap the given pytestfunct item for tracing support if --trace was given in
    the command line.r-N)r0r<r�)r�r!r!r"�&maybe_wrap_pytest_function_for_tracingLsr�)r�r��reprcCs�|jj�d�j}|��|jjj}d|jfd|jfd|j	ffD]N\}}||dfvr>|r>|�
dd|�|dd�d	kr�|dd�}|�|�q>|�
dd
�|�|�|�
dd�t|�}d|_
t|�|S)
NZterminalreporterr��stderr�log�allr`z	captured ����
�	tracebackzentering PDBT)r0r=r�Z_twrd�option�showcaptureZ	capstdoutZ	capstderrZcaplogrfZ
toterminalr�Z	_pdbshownr�)r�r�r�rir�ZsectionnameZcontentrsr!r!r"r�Ss&
�
r�r�cCsXddlm}t|j|�r$|jjdSt|jt�r<|jjdS|jdusJJ�|jdSdS)Nr)�UnexpectedException�)Zdoctestr�r�r�exc_inforr�Z_excinfo)r�r�r!r!r"r�rsr�)rzrcCs2t�d�}|��|�d|�|jr.t�d�dS)Nr�rl)r3r��resetZinteractionZquittingrrn)rz�pr!r!r"r��s

r�)3r�rr�rJ�typesr��typingrrrrrrrr	r
rkrZ
_pytest._coderr�r
rrrZ_pytest.config.argparsingrZ_pytest.config.exceptionsrZ
_pytest.nodesrZ_pytest.reportsrZ_pytest.capturerZ_pytest.runnerrr�r#r/rBr3r@r?r�r�r�r��
TracebackTyper�r�r!r!r!r"�<module>sR@
�

Youez - 2016 - github.com/yon3zu
LinuXploit