403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.52
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  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-312.pyc
�

}�e�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*�ZBd^d+�ZCd,e
d-e.d)eed.fd/�ZDeEej�j�d0�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				d_d?ed&d@eeJdAeEdBeJd)d=f
dC�ZRGdD�dEej��ZTd)eeUeEffdF�ZVdG�ZWdH�ZXGdI�dJej��ZZd`dK�Z[dLe\d)eJfdM�Z]ed)edNfdO��Z^GdP�dQej��Z_dReTd)e,fdS�Z`d)ed&fdT�ZadadU�Zbd)eEfdV�Zcd)eEfdW�Zdd)eEfdX�ZedYeUd)eEfdZ�Zfej�d[�\�d)eeUeffd]��Zhy)bz6Discover 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�~�|jddddg��|jddd�	�|jd
�}|jddd
dd��|jdtjddt
d��|jddgddd��|jddd
dd��|jddd
d d!��y)"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_addoptionrIHs���
�M�M��%�
���	���M�M��A�7���
�O�O�I�&�E�	�O�O����
0�
���
�O�O��
�Y�Y��
J�&�
�
��
�O�O�����
C�
�
��
�O�O�*���
,�
-���
�O�O�)���
M�
,���c��day�N)�RUNNER_CLASS�rJrH�pytest_unconfigurerOzs	���LrJ�	file_path�parent)�IPDoctestModule�IPDoctestTextfilec�$�|j}|jdk(rO|jjr8t	t|�t
|�f�stj||��}|Syt|||�rtj||��}|Sy)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�#>�#>�v�I�#>�#V�C��J��
�v�y�&�	1�!2�!>�!>�v�I�!>�!V���
�rJ�.�c�,�tt|�|�SrL)�
_collect_filer)rVrQs  rHrara�s���T�$�Z��0�0rJc�R�ddl}t|jj|��S)Nr)�py.path�_import_pathrV�local)rV�root�pys   rHr r �s����B�G�G�M�M�$�/�0�0rJrVc�V�|jdk7ry|j�}d|vxsd|vS)Nzsetup.pyFs
setuptoolss	distutils)�name�
read_bytes)rV�contentss  rHr[r[�s2���y�y�J������ �H��H�$�@���(@�@rJrWc����jdvr|jj��ry|jd�xsdg}t	�fd�|D��S)N)z.txtz.rstTr=z	test*.txtc3�6�K�|]}t|�����y�wrLr)�.0�globrVs  �rH�	<genexpr>z _is_ipdoctest.<locals>.<genexpr>�s�����8�$�z�$��%�8�s�)rX�session�
isinitpath�	getoptionrZ)rWrVrQ�globss `  rHr^r^�sL����{�{�&�&�6�>�>�+D�+D�T�+J�����_�-�>�+��E��8�%�8�8�8rJc� �|jdk(S)Nz__main__.py)rmrUs rHr\r\�s���9�9�
�%�%rJc�B�eZdZdeeeeefddfd�Zdeddfd�Z	y)�ReprFailDoctest�reprlocation_linesr+Nc��||_yrL)r|)�selfr|s  rH�__init__zReprFailDoctest.__init__�s��#5��rJ�twc�~�|jD].\}}|D]}|j|��|j|��0yrL)r|�line�
toterminal)r~r��reprlocation�linesr�s     rHr�zReprFailDoctest.toterminal�sD��#'�#:�#:�	(��L�%��
������
�
��#�#�B�'�	(rJ)
�__name__�
__module__�__qualname__r
rrrDrrr�rNrJrHr{r{�s>��5�"*�5�1A�8�C�=�1P�+Q�"R�5�	
�5�
(�^�(��(rJr{c�.��eZdZdedddf�fd�Z�xZS)�MultipleDoctestFailures�failureszdoctest.DocTestFailurer+Nc�0��t�|��||_yrL)�superrr�)r~r��	__class__s  �rHrz MultipleDoctestFailures.__init__�s���
���� ��
rJ)r�r�r�r
r�
__classcell__�r�s@rHr�r��s!���!��*B�!C�!��!�!rJr��IPDocTestRunnerc�6��ddl�ddlm}G�fd�d|�}|S)Nr�)r�c����eZdZdZ				ddeddeedededdf
�fd	�
Zd
ddd
deddf�fd�Z	d
ddd
de
eeee
jfddf�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.
        N�checkerr(�verbose�optionflags�continue_on_failurer+c�8��t�|�|||��||_y)N)r�r�r�)r�rr�)r~r�r�r�r�r�s     �rHrz8_init_runner_class.<locals>.PytestDoctestRunner.__init__�s!���
�G��W�g�;��W�':�D�$rJ�test�doctest.DocTest�examplezdoctest.Example�gotc�l���j|||�}|jr|j|�y|�rL)�DocTestFailurer�r;)r~�outr�r�r��failure�doctests      �rH�report_failurez>_init_runner_class.<locals>.PytestDoctestRunner.report_failure�s5���-�g�,�,�T�7�C�@�G��'�'��
�
�7�#��
rJ�exc_infoc���t|dt�r|d�t|dtj�rt	j
d��j|||�}|jr|j|�y|�)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�sm����(�1�+�'7�8��q�k�!��(�1�+�s�{�{�3��
�
�1�2�1�g�1�1�$���J�G��'�'��
�
�7�#��
rJ�NNrT)r�r�r��__doc__r�bool�intrrDr�rr�
BaseException�types�
TracebackTyper�r�)r�r�s@�rH�PytestDoctestRunnerr��s����	�;?�&*� �(,�	;��6�7�	;��d�^�	;��		;�
"&�	;��
	;�	�$�	�'�		�
�	��
	�	�$�	�'�		�
�D��/���@S�@S�S�T�	��
	�	rJr�)r��	ipdoctestr�)r�r�r�s  @rH�_init_runner_classr��s����*�-�o�-�^�rJr�r�r�r�c�@�t�
t�at||||��S)N�r�r�r�r�)rMr�r�s    rH�_get_runnerr��s-����)�+������/�	�rJc�D��eZdZ		ddedddeddedd	df
�fd
�
Zedddeddddf�fd��Zdd�Zdd
�Z	dd�Z
dd�Zdee
d	eeeff�fd�Zd	eedefeeeffd�Zeej*j-d�d�dkred	efd��Z�xZS�xZS)�
IPDoctestItemNrmrQz)Union[IPDoctestTextfile, IPDoctestModule]�runnerr��dtestr�r+c�^��t�|�||�||_||_d|_d|_yrL)r�rr�r��obj�fixture_request)r~rmrQr�r�r�s     �rHrzIPDoctestItem.__init__s1���	����v�&������
����9=��rJc�*��t�|�||||��S)zThe public named constructor.)rmrQr�r�)r�r])�clsrQrmr�r�r�s     �rHr]zIPDoctestItem.from_parents����w�"��V�F�RW�"�X�XrJc��|j��ot|�|_t|jj��}|jj	d�j�D]
\}}|||<�|jjj|�ddlm	}t|jjd|�r�i|_|jjtj�tjj|jj�tjjdd�t tjd<tj|j_yyy)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�D� ��D�$8�$8�$H�$H�I�E�#�3�3�C�C�%� ��e�g�
$���e�$��d��
$�
�J�J���#�#�E�*�,��$�*�*�-�-�a�0�)�<�&(��"��"�"�)�)�#�+�+�6����"�"�4�:�:�#3�#3�4�������T�*�.6����N�+�#&�;�;��
�
� �=�"rJc�R�ddlm}t|jjd|�rZi|j_tjj�tjj|j�|`
|jj
j�y)Nr�r�r)r�r�r�r�r�rxr�r��clearr�r�)r~r�s  rH�teardownzIPDoctestItem.teardownEsp��(��d�j�j�)�)�!�,�i�8�!�D�J�J���K�K�����K�K���t�1�1�2��"��
�
����� rJc���|j�J�|j�J�t|j�|j�g}t	t
d�}t
t
dd�}tj�}tj|jj�	|jj|j|d��tj|�|rtt
d|�n!t	t
d�rtt
d�	|rt|��y#tj|�|rtt
d|�wt	t
d�rtt
d�wwxYw)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�z�%�%�%��{�{�&�&�&��4�:�:�&��1�1�3�35�� '�x��5��$+�H�c�4�$@�!�
�����
������$�$�%�		'�
�K�K�O�O�D�J�J�H�%�O�H��H�H�V��#���#�'@�A���3�'���#�&��)�(�3�3���

�H�H�V��#���#�'@�A���3�'���#�&�(�s
�#(D#�#AE/c�J�tj�dk7ry|jjj	d�}|rd|jd��|j
�\}}tjj|�tjj|�yy)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~���?�?���(�����*�*�4�4�5E�F����)�)�d�)�3��1�1�3�H�C���J�J���S�!��J�J���S�!�	rJ�excinfoc����ddl}d}t|j|j|jf�r|jg}n0t|jt
�r|jj}|�t�|�!|�Sg}|D�]X}|j}|j}|j}|j�d}	n|j|jzdz}	t|�j}
t||	|
�}t!�}t#|j$j'd��}
|	��|jj(�J�|jj(j+d�}|j�J�t-|�D��cgc]\}}d||jzdz|fz��}}}|t/|jdz
d�|jdz}n=dg}d}|j0j+�D]}|j3d	|�d
|���d}�t||j�r0||j5||j6|
�j9d�z
}nwt;j<|j>�}|d
tA|j�zgz
}|tCjD|j>�D�cgc]}|jGd���c}z
}|j3||f���[tI|�Scc}}wcc}w)Nrr�r9Fz%03d %s�	z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z??? � z...�
zUNEXPECTED EXCEPTION: %s)%r�r�r�r�r�r�r�r��repr_failurer�r��filename�linenor0r�r�_get_checker�_get_report_choicerWrw�	docstring�
splitlines�	enumerate�max�sourcer;�output_differencer��splitr�
from_exc_infor��repr�	traceback�format_exception�stripr{)r~r�r�r�r|r�r�r�rr�messager�r��
report_choicer��i�x�indentr��
inner_excinfor�s                    �rHrzIPDoctestItem.repr_failure{s����	�
�	���M�M�G�2�2�G�4O�4O�P�
� �
�
��H�
��
�
�'>�
?��}�}�-�-�H����7�'��0�0����)	=�G��o�o�G��<�<�D��}�}�H��{�{�"������w�~�~�5��9���7�m�,�,�G�+�H�f�g�F�L�"�n�G�.�t�{�{�/D�/D�EV�/W�X�M��!��|�|�-�-�9�9�9����.�.�9�9�%�@���{�{�.�.�.�GP�QV�GW��=C�a��I��T�[�[��1�!4�a� 8�8�����c�'�.�.�1�"4�a�8�7�>�>�A�;M�N��V�����#�N�N�5�5�7�#�D��L�L�4��x�q���!7�8�"�F�#��'�7�#9�#9�:���2�2��W�[�[�-���%��+���!.� ;� ;�G�<L�<L� M�
��4�t�M�<O�<O�7P�P�Q�Q���+4�+E�+E�w�GW�GW�+X��&'�A�G�G�D�M����
�%�%�|�U�&;�<�S)	=�T�1�2�2��1��(s�!K.�0K4zos.PathLike[str]c�~�|j�J�|j|jjd|jzfS)Nz[ipdoctest] %s)r�rVrrm�r~s rH�
reportinfozIPDoctestItem.reportinfo�s7���z�z�%�%�%��y�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�s4���
/3�-1�>��>�<�>��*�+�	>�
�)�*�>�
�
>��
Y�;�
Y��	
Y�
"�
Y�!�
Y��
Y�/�2
!�4�<	"�>3��}�-�>3�
�s�L� �	!�>3�@J�E�%�(:�C�(?�"@�(�3�-�QT�"T�U�J��6���#�#�C�(��+�,�q�0�	�	%�$�	%�
�	%�1rJr�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_lookupr0�sZ����&�=�=�%�;�;�$�9�9��!�!� '� ?� ?� �1�1�-�/�)�+��!�
�
rJc�r�|jjd�}t�}d}|D]
}|||z}�|S)Nr-r)rW�getinir0)rQ�optionflags_str�flag_lookup_table�flag_acc�flags     rH�get_optionflagsr7�sI���m�m�*�*�+B�C�O�(�*���H��,���%�d�+�+��,��OrJc�R�|jd�}|r|jd�rd}|S)Nr@�usepdbF)�getvalue)rWr�s  rH�_get_continue_on_failurer;�s/�� �/�/�*I�J����?�?�8�$�"'���rJc���eZdZdZdeefd�Zeejjd�d�dkr#edefd��Z
eddd�d	eef�fd
��Z�xZS�xZS)rSNr+c#��K�ddl}ddlm}|jj	d�}|j
j
|�}t|j
�}|j
j}ddi}t|�}td|t�t|j���}	|�}
|
j||||d�}|jr&tj!||j|	|�	���yy�w)
Nrr�)�IPDocTestParserr2r��__main__F�r�r�r�r��rmr�r�)r�r�r>rWr2rV�	read_textrDrmr7r�rr;�get_doctestr�r�r])r~r�r>�encoding�textrrmrxr�r�r*r�s            rHr3zIPDoctestTextfile.collect�s������.��;�;�%�%�&:�;���y�y�"�"�8�,���t�y�y�>���y�y�~�~���Z�(��%�d�+����#� �N� 8���� E�	
��!�"���!�!�$��t�X�q�A���=�=��+�+��4�9�9�V�4�,��
��s�C4C6rbrrcc�,�t|j�SrLrrs rHrVzIPDoctestTextfile.path
rrJ�r�rVrVc�j��|�ddl}|jj|�}t�|�d||d�|��S�Nr)rQr�rN�rgrVrir�r]�r�rQr�rV�kwrkr�s      �rHr]zIPDoctestTextfile.from_parent�:�����������t�,���7�&�J�f�V�J�r�J�JrJ)r�r�r�r�r	r�r3r�r r!rr"rrVrrr]r�r�s@rHrSrS�s����
�C���-�0��8�6���#�#�C�(��+�,�q�0�	�	%�$�	%�
�	%�
�
�#'�	K�
�4�.�	K�
�	K�1rJrSc�z��ddl�t�fd�|jD��}|rtjd�yy)zVRaise pytest.skip() if all examples in the given DocTest have the SKIP
    option set.rNc3�j�K�|]*}|jj�jd����,y�w)FN)�options�get�SKIP)rrrr�s  �rHrtz%_check_all_skipped.<locals>.<genexpr>#s$�����P�Q�a�i�i�m�m�G�L�L�%�8�P�s�03z%all docstests skipped by +SKIP option)r��allr�r �skip)r��all_skippedr�s  @rHr�r�s1�����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_mockedrX(s��	�S�M�t�T��	�rJ)NNNc#��K�tj�dd�dtdtfdtttgtfdtf�fd�}|t_	d���t_y#�t_wxYw�w)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)NrZc�.��t|�xs���SrL)rX)r��_stopr\s ��rH�<lambda>zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>>s���j��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)rX�	Exception�warnings�warnr")r\r[�er_�real_unwraps`  @�rH�_mock_aware_unwrapz4_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap7si���	��|�t�z�1�"�4�j�9�9��E��t�*T�U�U���	��M�M�GH��O��	
�
��	�s�-�-�	A�"A�A)�inspect�unwraprrr)rfres @rH�_patch_unwrap_mock_awareri1sn������.�.�K�MQ���s�C�x� ��+3�H�c�U�C�Z�4H�+I��	��"(�G�N�%�
�$�������s�AA9�A)�A9�)
A6�6A9c���eZdZdeefd�Zeejjd�d�dkr#e
defd��Ze
ddd�d	eef�fd
��Z�xZS�xZS)rRr+c#�<K�ddl}ddlm}m}Gd�d|�}|jj
dk(r�t
tjjd�d�dkrJ|jjj|j|jjd	��}n�|jjj|j|jjd	�|jj�
�}n,	t|j|jj��}||���}t'|�}t)d|t+�t-|j���}|j/|j0�D]4}	|	j2s�t4j7||	j
||	�����6y#t $rB|jj#d�r#tj$d
|jz�n�Y��wxYw�w)Nrr�)�
DocTestFinderr>c�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�r
t|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�rgrhr��_find_lineno)r~r��source_linesr�s   �rHrrzDIPDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno[sO����c�8�,�!�#�v�s�3�C��3�
�.�!�.�.��-�C��w�+�� ��rJc
���t|�ryt�5t�|�
|||||||�ddd�y#1swYyxYwrL)rXrir��_find)	r~�testsr�rm�modulersrx�seenr�s	        �rHruz=IPDoctestModule.collect.<locals>.MockAwareDocTestFinder._findosE����c�?��-�/���G�M��s�D�&�,��t�����s	�7�Ar)r�r�r�r�rrrur�r�s@rH�MockAwareDocTestFinderrnTs���
�
�(	
��	
�	
rJryzconftest.pyrbrc�
importmode)�rootpath)rjr?zunable to import module %r)r*Fr@rA)r�r�rlr>rVrmr�r r!rrWr��_importconftestrwr{r �ImportErrorr:rTr7r�rr;�findr�r�r�r])
r~r�rlr>ryrw�finderr�r�r�s
          rHr3zIPDoctestModule.collectPs������=�$	�]�$	�L�9�9�>�>�]�*��6�%�%�+�+�C�0��3�4�q�8����2�2�B�B��I�I��K�K�)�)�,�7���
���2�2�B�B��I�I��K�K�)�)�,�7�!�[�[�1�1�C���
�$�T�Y�Y�T�[�[�5I�5I�J��(��/@�A��%�d�+����#� �N� 8���� E�	
���K�K�����8�	�D��}�}�#�/�/��t�y�y��t�0���	���
��;�;�'�'�(H�I��K�K� <�t�y�y� H�I��J�
�s2�D	H�+G�7A.H�&(H�AH�H�H�Hrbrrcc�,�t|j�SrLrrs rHrVzIPDoctestModule.path�rrJNrGrVc�j��|�ddl}|jj|�}t�|�d||d�|��SrIrJrKs      �rHr]zIPDoctestModule.from_parent�rMrJ)r�r�r�r	r�r3r�r r!rr"rrVrrr]r�r�s@rHrRrROs����L��-�0�L�\�6���#�#�C�(��+�,�q�0�	�	%�$�	%�
�	%�
�
�#'�	K�
�4�.�	K�
�	K�1rJrR�doctest_itemc��dd�}i|_|jj}|j||dd��|_t|d��}|j
�|S)zIUsed by IPDoctestTextfile and IPDoctestItem to setup fixture information.Nc��yrLrNrNrJrHr\z_setup_fixtures.<locals>.func�s��rJF)�noder\r��funcargsT)�	_ispytestr)r�ru�_fixturemanager�getfixtureinfo�_fixtureinfor�
_fillfixtures)r�r\�fmr�s    rHr�r��sc��
��L��	�	�	�	-�	-�B� "� 1� 1�
��$��!2�!�L��%�\�T�B�O��!�!�#��rJc�>��ddl}ddl�ddlm}G�fd�d|�}|S)Nrr�)r(c����eZdZW�jdW�j�ZW�jdW�j�ZW�jdW�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�|�|||�ry|t�z}|t�z}|t	�z}|s|s|sydt
tdtdtf�	fd�}|r&||j|�}||j|�}|r&||j|�}||j|�}|r|j||�}t�|�|||�S)NTF�regexr`r+c�*���j|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�2rJ)
r��check_outputr,r-r.r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�s�����w�#�D�#�{�;��'�*A�*C�C�M�%�(=�(?�?�K�&�)9�);�;�L� ��\��
3�w�s�|�
3�#�
3�#�
3��&�t�'?�'?��F��%�d�&>�&>��D���&�t�'=�'=�t�D��%�d�&<�&<�c�B����5�5�d�C�@���7�'��c�;�?�?rJc�.�t|jj|��}t|jj|��}t|�t|�k7r|Sd}t	||�D�]!\}}|jd�}|jd�}	|	�|jd�}	|�dn
t|�}
|	�|
t
|	�z}
t|j��tt|j��d|
z��k(s��|d|j�|z|j�z||j�|zdz}||j�|j�z
|j�|j�z
z
z
}��$|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_precisionsc������1�1�$�7�8�E�����0�0��5�6�D��5�z�S��Y�&��
��F��E�4�(�
J���1�*+�'�'�*�*=��*+�'�'�+�*>���#� �w�w�{�3�H�!)�!1�A�s�8�}�	��'���X��.�I������#�v�e�A�G�G�I�.>�B��
�N�'S�S�
�0�a�g�g�i�&�0�1�A�G�G�I�=��A�E�E�G�f�DT�DV�@W�W���a�e�e�g����	�1�Q�U�U�W�q�w�w�y�5H�I�I�F�
J� �JrJ)r�r�r��compile�UNICODEr�r��VERBOSEr�rDr�r�r�r�r�)r�r�s@�rH�LiteralsOutputCheckerr��s����
!�j�j�)C�R�Z�Z�P���J�J�'A�2�:�:�N���Z�Z�
�&
�J�J�)
�
�.	@�S�	@�s�	@��	@��	@�6	�3�	�S�	�S�	rJr�)r�r�r�r()r�r(r�r�s   @rH�_init_checker_classr��s$����
�1�O� 6�O�b!� rJc�6�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�rNrJrHrrs����+�-�
��?�rJc�.�ddl}|jd�S)z+Register and return the ALLOW_UNICODE flag.rNr)�r��register_optionflagr/s rHr,r,1s���&�7�&�&��7�7rJc�.�ddl}|jd�S)z)Register and return the ALLOW_BYTES flag.rNr*r�r/s rHr-r-8s���&�7�&�&�}�5�5rJc�.�ddl}|jd�S)z$Register and return the NUMBER flag.rNr+r�r/s rHr.r.?s���&�7�&�&�x�0�0rJ�keyc
��ddl}t|jt|jt
|jt|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  rHrrFsN���	$�W�%9�%9�#�W�%9�%9�#�W�%9�%9�0�'�2S�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�Ws���6�MrJrr�)r�r�r+N)r+r()ir�r�r�rgr�r�r�rr�rb�
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!rrerhr�r[r^r\r{rar�r�r��Itemr�rDr0r7r;�ModulerSr��objectrXrirRr�r�rr,r-r.r�fixturer�rNrJrH�<module>r�sZ��=��
��	��
����%������������� ��
��,�/�+�&�'�!�,�+�#�-�&�'�%�/���#��%��%��%��+?�(�����,�����:>�
�x��5�6�7�>�/�V�/��/�d�������e�:�;�<��"�v������$�Q�'�(�1�,�'�M�1��1�
�%�>�?�	@�1��L�1�A�t�A��A�9�&�9��9�i�9�D�9�&�d�&�t�&�
(�l�
(�!�i�!�3�D�!2�3�3�n37�"�� $�	�
�.�
/��
�d�^�����	�
��(r%�F�K�K�r%�j
�$�s�C�x�.�
� ��2K��
�
�2K�j=��F��t���%�)�,<�"=�%��%�:bK�f�m�m�bK�J
�-�
�N�
� V!�T�":�;�V!�r�(8��8�6�s�6�1�#�1��C��C��"����i� ��T�#�s�(�^��!�rJ

Youez - 2016 - github.com/yon3zu
LinuXploit