????

Your IP : 18.219.68.121


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/doctest.cpython-311.pyc

�

�܋fie���UdZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZddl
mZddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddl
mZdd
l
mZddl
mZddl
mZddl
mZddl
mZddlmZddlmZddlmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl)m+Z+ddl,m-Z-ddl,m.Z.ddl/m0Z0ddl/m1Z1dd l2m3Z3dd!l2m4Z4dd"l5m6Z6dd#l7m8Z8dd$l9m:Z:erddl;Z;d%Z<d&Z=d'Z>d(Z?d)Z@e<e=e>e?e@fZAdaBdaCeed*eDd+<d,e(d-dfd.�ZEdad/�ZFd0ed1e-d-eed2fd3�ZGd4ed-eHfd5�ZId6e&d4ed1e-d-eHfd7�ZJd4ed-eHfd8�ZKGd9�d:e ��ZLGd;�d<eM��ZNd-ed=fd>�ZO				dbd@ed*dAeeHdBePdCeHd-d=f
dD�ZQGdE�dFe.��ZRd-eeSePffdG�ZTdH�ZUdI�ZVGdJ�dKe6��ZWdcdN�ZXdOeYd-eHfdP�ZZe
d-edQfdR���Z[GdS�dTe6��Z\dUeRd-e+fdV�Z]d-ed*fdW�Z^dddX�Z_d-ePfdY�Z`d-ePfdZ�Zad-ePfd[�Zbd\eSd-ePfd]�Zce*d^�_��d-eeSeffd`���ZddS)ez4Discover and run doctests 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)�fixture)�FixtureRequest)�	Collector)�Item)�OutcomeException)�skip��
fnmatch_ex)�import_path)�Module)�approx)�
PytestWarning�none�cdiff�ndiff�udiff�only_first_failure�doctest.OutputChecker�
CHECKER_CLASS�parser�returnc��|�ddddg���|�ddd�	��|�d
��}|�ddd
dd���|�dtjddt
d���|�ddgddd���|�ddd
dd���|�ddd
d d!���dS)"N�doctest_optionflagszOption flags for doctests�args�ELLIPSIS)�type�default�doctest_encodingzEncoding used for doctest fileszutf-8)r5�collectz--doctest-modules�
store_trueFzRun doctests in all .py modules�doctestmodules)�actionr5�help�destz--doctest-reportr*z9Choose another output format for diffs on doctest failure�
doctestreport)r4r5r;�choicesr<z--doctest-glob�append�patz2Doctests file matching pattern, default: test*.txt�doctestglob)r:r5�metavarr;r<z--doctest-ignore-import-errorszIgnore doctest ImportErrors�doctest_ignore_import_errorsz--doctest-continue-on-failurez<For a given doctest, continue to run after the first failure�doctest_continue_on_failure)�addini�getgroup�	addoption�str�lower�DOCTEST_REPORT_CHOICES)r.�groups  �`/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/doctest.py�pytest_addoptionrMEsO��
�M�M��#�
���	�����M�M��=�w�����
�O�O�I�&�&�E�	�O�O����
.�
�����
�O�O��
�Y��
H�&�
�
����
�O�O�����
A�
�
����
�O�O�(���
*�
+�����
�O�O�'���
K�
*�������c�
�dadS�N)�RUNNER_CLASS�rNrL�pytest_unconfigurerSws
���L�L�LrN�	file_path�parent)�
DoctestModule�DoctestTextfilec�4�|j}|jdkrV|jjrIt	t|��t
|��f��st�||���}|Sn/t|||��rt�||���}|SdS)Nz.py��path)�config�suffix�optionr9�any�_is_setup_py�_is_main_pyrV�from_parent�_is_doctestrW)rTrUr[�mod�txts     rL�pytest_collect_filere}s����]�F���5� � ��=�'�	��
�)�
$�
$�k�)�&<�&<�=�1
�1
�	�"/�!:�!:�6�	�!:�!R�!R�C��J��	�V�Y��	/�	/��.�:�:�6�	�:�R�R���
��4rNrZc�T�|jdkrdS|���}d|vpd|vS)Nzsetup.pyFs
setuptoolss	distutils)�name�
read_bytes)rZ�contentss  rLr_r_�s8���y�J����u���� � �H��H�$�@���(@�@rNr[c����jdvr|j����rdS|�d��pdg}t	�fd�|D����S)N)z.txtz.rstTrAz	test*.txtc3�8�K�|]}t|���V��dSrPr!)�.0�globrZs  �rL�	<genexpr>z_is_doctest.<locals>.<genexpr>�s-�����8�8�$�z�$��%�%�8�8�8�8�8�8rN)r\�session�
isinitpath�	getoptionr^)r[rZrU�globss `  rLrbrb�sh����{�&�&�&�6�>�+D�+D�T�+J�+J�&��t����]�+�+�<��}�E��8�8�8�8�%�8�8�8�8�8�8rNc��|jdkS)Nz__main__.py)rgrYs rLr`r`�s���9�
�%�%rNc�V�eZdZdeeeeefddfd�Zdeddfd�Z	dS)�ReprFailDoctest�reprlocation_linesr/Nc��||_dSrP)rv)�selfrvs  rL�__init__zReprFailDoctest.__init__�s��#5����rN�twc�~�|jD]4\}}|D]}|�|���|�|���5dSrP)rv�line�
toterminal)rxrz�reprlocation�linesr|s     rLr}zReprFailDoctest.toterminal�sZ��#'�#:�	(�	(��L�%��
�
������
�
�
�
��#�#�B�'�'�'�'�	(�	(rN)
�__name__�
__module__�__qualname__r
rrrHryrr}rRrNrLruru�sn������5�"*�5�1A�8�C�=�1P�+Q�"R�5�	
�5�5�5�5�
(�^�(��(�(�(�(�(�(rNruc�4��eZdZdedddf�fd�Z�xZS)�MultipleDoctestFailures�failureszdoctest.DocTestFailurer/Nc�V��t�����||_dSrP)�superryr�)rxr��	__class__s  �rLryz MultipleDoctestFailures.__init__�s$���
�������� ��
�
�
rN)r�r�r�r
ry�
__classcell__�r�s@rLr�r��sQ�������!��*B�!C�!��!�!�!�!�!�!�!�!�!�!rNr��doctest.DocTestRunnerc�:��ddl�G�fd�d�j��}|S)Nrc����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�ryr�)rxr�r�r�r�r�s     �rLryz8_init_runner_class.<locals>.PytestDoctestRunner.__init__�s2���
�G�G���W�g�;��W�W�W�':�D�$�$�$rN�test�doctest.DocTest�examplezdoctest.Example�gotc�h���j|||��}|jr|�|��dS|�rP)�DocTestFailurer�r?)rx�outr�r�r��failure�doctests      �rL�report_failurez>_init_runner_class.<locals>.PytestDoctestRunner.report_failure�sC���-�g�,�T�7�C�@�@�G��'�
��
�
�7�#�#�#�#�#��
rN�exc_infoc���t|dt��r|d�t|dtj��rt	jd���j|||��}|jr|�|��dS|�)N�zQuitting debugger)	�
isinstancer�bdb�BdbQuitr�exit�UnexpectedExceptionr�r?)rxr�r�r�r�r�r�s      �rL�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�#�#�#�#�#��
rN�NNrT)r�r�r��__doc__r�bool�intryrHr�rr�
BaseException�types�
TracebackTyper�r�)r�r�s@�rL�PytestDoctestRunnerr��s5��������	�	�:>�&*� �(,�	;�	;��5�6�	;��d�^�	;��		;�
"&�	;��
	;�	;�	;�	;�	;�	;�	�$�	�'�		�
�	��
	�	�	�	�	�	�	�$�	�'�		�
�D��/���@S�S�T�	��
	�	�	�	�	�	�	�	�	�	rNr�)r��DebugRunner)r�r�s @rL�_init_runner_classr��sL����N�N�N�-�-�-�-�-�-�-�g�1�-�-�-�^�rNTr�r�r�r�c�R�t�t��at||||���S)N�r�r�r�r�)rQr�r�s    rL�_get_runnerr��s:����)�+�+������/�	���rNc���eZdZ		ddedddeddedd	df
�fd
�
Zedddeddddf�fd���Zdd�Zdd
�Z	dd�Z
deed	e
eeff�fd�Zd	ee
defeeeffd�Z�xZS)�DoctestItemNrgrUz%Union[DoctestTextfile, DoctestModule]�runnerr��dtestr�r/c���t���||��||_||_d|_d|_dSrP)r�ryr�r��obj�fixture_request)rxrgrUr�r�r�s     �rLryzDoctestItem.__init__�sB���	������v�&�&�&������
����9=����rNc�N��t���||||���S)zThe public named constructor.)rgrUr�r�)r�ra)�clsrUrgr�r�r�s     �rLrazDoctestItem.from_parent
s'����w�w�"�"��V�F�RW�"�X�X�XrNc� �|j��t|��|_t|jj���}|j�d�����D]
\}}|||<�|jj�|��dSdS)N)�
getfixture�doctest_namespace)r��_setup_fixturesr��dict�getfixturevalue�itemsrr�update)rxrrrg�values    rL�setupzDoctestItem.setups����:�!�#2�4�#8�#8�D� ��D�$8�$H�I�I�I�E�#�3�C�C�#� � ��e�g�g�
$�
$���e�$��d����J��#�#�E�*�*�*�*�*�"�!rNc���|j�J�|j�J�t|j��|���g}|j�|j|���|rt|���dS)N)r�)r�r��_check_all_skipped�$_disable_output_capturing_for_darwin�runr�)rxr�s  rL�runtestzDoctestItem.runtest!s����z�%�%�%��{�&�&�&��4�:�&�&�&��1�1�3�3�3�35��	
�����
���1�1�1��	4�)�(�3�3�3�	4�	4rNc�T�tj��dkrdS|jj�d��}|rm|�d���|���\}}tj�	|��tj
�	|��dSdS)zFDisable output capturing. Otherwise, stdout is lost to doctest (#985).�DarwinN�capturemanagerT)�in_)�platform�systemr[�
pluginmanager�	getplugin�suspend_global_capture�read_global_capture�sys�stdout�write�stderr)rx�capmanr��errs    rLr�z0DoctestItem._disable_output_capturing_for_darwin-s����?����(�(��F���*�4�4�5E�F�F���	"��)�)�d�)�3�3�3��1�1�3�3�H�C���J���S�!�!�!��J���S�!�!�!�!�!�		"�	"rN�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�r=Fc�:��g|]\}}d|�jzdz|fz��S)z%03d %sr�)�lineno)rl�i�xr�s   �rL�
<listcomp>z,DoctestItem.repr_failure.<locals>.<listcomp>_s?������=C�a��I��T�[��1�!4�a� 8�8���rN�	z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z??? � z...�
zUNEXPECTED EXCEPTION: %sc�8�g|]}|�d����S)r�)�strip)rlr�s  rLr�z,DoctestItem.repr_failure.<locals>.<listcomp>ss/�����&'�A�G�G�D�M�M���rN)$r�r�r�r�r�r�r�r��repr_failurer�r��filenamer�r4r�r�_get_checker�_get_report_choicer[rq�	docstring�
splitlines�	enumerate�max�sourcer?�output_differencer��splitr�
from_exc_infor��repr�	traceback�format_exceptionru)rxr�r�r�rvr�r�r�r��messager~r��
report_choicer�indentr|�
inner_excinfor�r�s                 @�rLr�zDoctestItem.repr_failure9s�����	����
�	���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�_�/U�/U�V�V�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�2rNzos.PathLike[str]c�L�|j�J�|j|jjd|jzfS)Nz[doctest] %s)r�rZr�rg)rxs rL�
reportinfozDoctestItem.reportinfoys+���z�%�%�%��y�$�*�+�^�d�i�-G�G�GrN)NN�r/N)r�r�r�rHrry�classmethodrar�r�r�rr�rrr�rr�r�r�r�s@rLr�r��s��������
59�-1�>�>��>�8�>��0�1�	>�
�)�*�>�
�
>�>�>�>�>�>��
Y�7�
Y��	
Y�
(�
Y�!�
Y�
Y�
Y�
Y�
Y��[�
Y�+�+�+�+�
4�
4�
4�
4�	"�	"�	"�	"�>3��}�-�>3�
�s�L� �	!�>3�>3�>3�>3�>3�>3�@H�E�%�(:�C�(?�"@�(�3�-�QT�"T�U�H�H�H�H�H�H�H�HrNr�c��ddl}t|j|j|j|j|j|jt��t��t����	�	S)Nr)	�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACEr3�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�
ALLOW_UNICODE�ALLOW_BYTES�NUMBER)r�r�rrrr3rr�_get_allow_unicode_flag�_get_allow_bytes_flag�_get_number_flag�r�s rL�_get_flag_lookupr~sa���N�N�N��&�=�%�;�$�9��!� '� ?� �1�-�/�/�)�+�+��!�!�
�
�
�
rNc�z�|j�d��}t��}d}|D]
}|||z}�|S)Nr1r)r[�getinir)rU�optionflags_str�flag_lookup_table�flag_acc�flags     rL�get_optionflagsr�sO���m�*�*�+@�A�A�O�(�*�*���H��,�,���%�d�+�+����OrNc�b�|�d��}|r|�d��rd}|S)NrD�usepdbF)�getvalue)r[r�s  rL�_get_continue_on_failurer�s?�� �/�/�*G�H�H���(��?�?�8�$�$�	(�"'���rNc�*�eZdZdZdeefd�ZdS)rWNr/c#��K�ddl}|j�d��}|j�|��}t|j��}|jj}ddi}t|��}td|t��t|j�����}|j��}	|	�||||d��}
|
j
r't�||
j||
���V�dSdS)Nrr6r��__main__F�r�r�r�r��rgr�r�)r�r[rrZ�	read_textrHrgrr�r�r�
DocTestParser�get_doctest�examplesr�ra)rxr��encoding�textr�rgrrr�r�r.r�s           rLr7zDoctestTextfile.collect�s���������;�%�%�&8�9�9���y�"�"�8�,�,���t�y�>�>���y�~���Z�(��%�d�+�+����#� �N�N� 8��� E� E�	
�
�
��'��&�(�(���!�!�$��t�X�q�A�A���=�	��)�)��4�9�V�4�*���
�
�
�
�
�	�	rN)r�r�r�r�r	r�r7rRrNrLrWrW�s9������
�C���+�.������rNrWr�r�c�v��ddl�t�fd�|jD����}|rtd��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)rlr�r�s  �rLrnz%_check_all_skipped.<locals>.<genexpr>�s5�����P�P�Q�a�i�m�m�G�L�%�8�8�P�P�P�P�P�PrNz!all tests skipped by +SKIP option)r��allr r )r��all_skippedr�s  @rLr�r��sY����N�N�N��P�P�P�P�$�-�P�P�P�P�P�K��2��
0�1�1�1�1�1�2�2rNr�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 rL�
_is_mockedr,�s!��	�S�M�t�T�T��	�rN)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
����SrP)r,)r��_stopr0s ��rL�<lambda>zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>�s���j��o�o�6T���t���rNzGot 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&)r0r/�er3�real_unwraps`  @�rL�_mock_aware_unwrapz4_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap�s������	��|�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)r:r9s @rL�_patch_unwrap_mock_awarer=�s�������.�K�MQ�����s�C�x� ��+3�H�c�U�C�Z�4H�+I��	�������"(�G�N�%�
����$���������$�$�$�$s�&A8�8Bc�&�eZdZdeefd�ZdS)rVr/c#�K�ddl}Gd�d|j��}|jjdkrJ|jj�|j|j�d��|jj���}n~	t|j|jj|j�d�����}nC#t$r6|j�d��rtd	|jz��n�YnwxYw|��}t|��}td
|t��t!|j�����}|�||j��D].}|jr%t(�||j||���V��/dS)
Nrc�2��eZdZdZ�fd�Z		d�fd�Z�xZS)�5DoctestModule.collect.<locals>.MockAwareDocTestFinderz�A hackish doctest 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��property�getattr�hasattrr;r<r��_find_lineno)rxr��source_linesr�s   �rLrHzBDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno�sm����c�8�,�,�4�!�#�v�s�3�3�C��3�
�.�.�.�!�.��-�-�C��w�w�+�+�� ���rNr/Nc
����t|��rdSt��5t���|||||||��ddd��dS#1swxYwYdSrP)r,r=r��_find)	rx�testsr�rg�modulerIrr�seenr�s	        �rLrKz;DoctestModule.collect.<locals>.MockAwareDocTestFinder._finds�����c�?�?���F�-�/�/����G�G�M�M��s�D�&�,��t������������������������s�(A�A�Ar�)r�r�r�r�rHrKr�r�s@rL�MockAwareDocTestFinderrA�sh�������
�
�
�
�
�
�
�(	
��	
�	
�	
�	
�	
�	
�	
�	
�	
�	
rNrOzconftest.py�
importmode)�rootpath)�root�moderCzunable to import module %rFrr)r��
DocTestFinderrZrgr[r��_importconftestrqrQr#�ImportErrorrr rr�r�r�findr�r r�ra)rxr�rOrM�finderr�r�r�s        rLr7zDoctestModule.collect�s���������$	�$	�$	�$	�$	�W�%:�$	�$	�$	�L�9�>�]�*�*��[�.�>�>��	���%�%�l�3�3���-�?���F�F�

�$��I���-���.�.�|�<�<�������
�
�
�
��;�'�'�(F�G�G���5��	�A�B�B�B�B��C�B�
����(�'�)�)��%�d�+�+����#� �N�N� 8��� E� E�	
�
�
���K�K����8�8�	�	�D��}�
�!�-�-��t�y��t�.�������	�	s�59B/�/=C/�.C/N)r�r�r�r	r�r7rRrNrLrVrV�s;������I��+�.�I�I�I�I�I�IrNrV�doctest_itemc��dd�}i|_|jj}|�||dd���|_t|d���}|���|S)	zEUsed by DoctestTextfile and DoctestItem to setup fixture information.r/Nc��dSrPrRrRrNrLr0z_setup_fixtures.<locals>.funcAs���rNF)�noder0r��funcargsT)�	_ispytestr�)r]ro�_fixturemanager�getfixtureinfo�_fixtureinfor�
_fillfixtures)rYr0�fmr�s    rLr�r�>s}��
�
�
�
��L��	�	�	-�B� "� 1� 1�
��$��!2�!�!�L��%�\�T�B�B�B�O��!�!�#�#�#��rNc�B��ddl}ddl�G�fd�d|j��}|S)Nrc�����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�regexrdr/c�2����|d|��S)Nz\1\2)�sub)rird�res  �rL�remove_prefixeszX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes{s����v�v�e�W�c�2�2�2rN)
r��check_outputrr	r
rrH�_unicode_literal_re�_bytes_literal_re�_remove_unwanted_precision)
rxrgr�r��
allow_unicode�allow_bytes�allow_numberrmr�rls
        ��rLrnz?_init_checker_class.<locals>.LiteralsOutputChecker.check_outputpsI����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�;�?�?�?rNc���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�ziprKr��floatr%�start�end)rxrgr��wants�gots�offset�w�grv�exponent�	precisions           rLrqzM_init_checker_class.<locals>.LiteralsOutputChecker._remove_unwanted_precision�s������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��
�N�'S�'S�'S�S�S�
�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���JrN)r�r�r��compile�UNICODErorp�VERBOSEr|rHr�r�rnrqr�)r�rls@�rL�LiteralsOutputCheckerrfRs���������
!�j�j�)C�R�Z�P�P���J�J�'A�2�:�N�N���Z�Z�
�&
�J�)
�
�
�.	@�S�	@�s�	@��	@��	@�	@�	@�	@�	@�	@�	@�6	�3�	�S�	�S�	�	�	�	�	�	�	�	rNr�)r�rl�
OutputChecker)r�r�rls  @rL�_init_checker_classr�Ns_����N�N�N�
�I�I�I�O�O�O�O�O�O�O�� 5�O�O�O�b!� rNc�H�t�t��at��S)a�Return a doctest.OutputChecker 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
      doctest should run in Python 2 and Python 3.

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

    An inner class is used to avoid importing "doctest" at the module
    level.
    )r-r�rRrNrLr�r��s����+�-�-�
��?�?�rNc�*�ddl}|jd��S)z+Register and return the ALLOW_UNICODE flag.rNr�r��register_optionflagrs rLrr�s���N�N�N�&�7�&��7�7�7rNc�*�ddl}|jd��S)z)Register and return the ALLOW_BYTES flag.rNrr�rs rLr	r	�s���N�N�N�&�7�&�}�5�5�5rNc�*�ddl}|jd��S)z$Register and return the NUMBER flag.rNrr�rs rLr
r
�s���N�N�N�&�7�&�x�0�0�0rN�keyc
��ddl}t|jt|jt
|jt|jtdi|S)z�Return the actual `doctest` module flag value.

    We want to do it as late as possible to avoid importing `doctest` 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  rLr�r��sH���N�N�N�	$�W�%9�#�W�%9�#�W�%9�0�'�2S�"�A��
�
�rNro)�scopec��t��S)a�Fixture that returns a :py:class:`dict` that will be injected into the
    namespace of doctests.

    Usually this fixture is used in conjunction with another ``autouse`` fixture:

    .. code-block:: python

        @pytest.fixture(autouse=True)
        def add_np(doctest_namespace):
            doctest_namespace["np"] = numpy

    For more details: :ref:`doctest_namespace`.
    )r�rRrNrLr�r��s
���6�6�MrNr�r�)r�r�r/N)r/r,)er�r�r;�osr�r�r�r�r6�
contextlibr�pathlibr�typingrrrrr	r
rrr
rrrr�_pytestr�_pytest._code.coderrr�_pytest._ior�_pytest.compatr�_pytest.configr�_pytest.config.argparsingr�_pytest.fixturesrr�
_pytest.nodesrr�_pytest.outcomesrr �_pytest.pathlibr"r#�_pytest.pythonr$�_pytest.python_apir%�_pytest.warning_typesr&r�r�r�r�r�r�rJrQr-�__annotations__rMrSrer�r_rbr`rur5r�r�r�r�r�rHrrrrWr��objectr,r=rVr�r�r�rr	r
r�r�rRrNrL�<module>r�s9��:�:�:�
�
�
�
�����	�	�	�	�����
�
�
�
�������������%�%�%�%�%�%������������������������������������������������������������������������� � � � � � �������������,�,�,�,�,�,�/�/�/�/�/�/�+�+�+�+�+�+�&�&�&�&�&�&�'�'�'�'�'�'�!�!�!�!�!�!�,�,�,�,�,�,�$�$�$�$�$�$�+�+�+�+�+�+�#�#�#�#�#�#�������-�-�-�-�-�-�!�!�!�!�!�!�&�&�&�&�&�&�'�'�'�'�'�'�!�!�!�!�!�!�%�%�%�%�%�%�/�/�/�/�/�/����N�N�N�#��%��%��%��+?�(�����,�����9=�
�x��4�5�6�=�=�=�/�V�/��/�/�/�/�d����������e�6�7�8�����"A�t�A��A�A�A�A�9��9�d�9�I�9�$�9�9�9�9�&�d�&�t�&�&�&�&�
(�
(�
(�
(�
(�l�
(�
(�
(�!�!�!�!�!�i�!�!�!�2�D�!8�9�2�2�2�2�l26�"�� $�	��
�-�
.��
�d�^�����	�
�����(H�H�H�H�H�$�H�H�H�D
�$�s�C�x�.�
�
�
�
� �����������f����>2�2�2�2��F��t������%�)�,<�"=�%�%�%���%�:J�J�J�J�J�F�J�J�J�Z
�+�
�.�
�
�
�
� U!�T�"9�:�U!�U!�U!�U!�p����(8��8�8�8�8�6�s�6�6�6�6�1�#�1�1�1�1��C��C�����"	��y�����4��S��>��������rN