Your IP : 3.138.100.233


Current Path : /opt/alt/python313/lib64/python3.13/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/__pycache__/doctest.cpython-313.opt-2.pyc

�

*}g����Sr/SQrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKJ
r
Jr SSKJr SSKrSSKJrJr "SS\"SS	55r0rS
r\"S5r\"S5r\"S
5r\"S5r\"S5r\"S5r\\-\-\-\-\-r\"S5r\"S5r\"S5r \"S5r!\"S5r"\\-\ -\!-\"-r#Sr$Sr%Sr&S[Sjr'Sr(Sr)S\Sjr*Sr+"SS\
5r,S r-S!r.S"r/"S#S$\R`5r1S%r2"S&S'5r3"S(S)5r4"S*S+5r5"S,S-5r6"S.S/5r7S0\8\9-S1\:4S2jr;"S3S45r<"S5S6\=5r>"S7S8\=5r?"S9S:\75r@SqAS]S=jrBS;SSSSS;SSS<\5"5S4S>jrCS^S?jrDSqES@rF"SASB\R�5rH"SCSD\H5rI"SESF\R�5rKS_SGjrL"SHSI\H5rMS;SS\5"5S4SJjrNSKrOSLrPSMrQS`SNjrRS`SOjrSSaSPjrT"SQSR5rU\USSSTSUSVSWSX.rVSYrW\XSZ:Xa\	R�"\W"55 gg)bzreStructuredText en)!�register_optionflag�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACE�ELLIPSIS�SKIP�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�REPORT_UDIFF�REPORT_CDIFF�REPORT_NDIFF�REPORT_ONLY_FIRST_FAILURE�REPORTING_FLAGS�	FAIL_FAST�Example�DocTest�
DocTestParser�
DocTestFinder�
DocTestRunner�
OutputChecker�DocTestFailure�UnexpectedException�DebugRunner�testmod�testfile�run_docstring_examples�DocTestSuite�DocFileSuite�set_unittest_reportflags�script_from_examples�
testsource�	debug_src�debug�N)�StringIO�IncrementalNewlineDecoder)�
namedtuple)�
ANSIColors�can_colorizec�<^�\rSrSrSS.U4SjjrU4SjrSrU=r$)�TestResults�or#��skippedc�4>�[TU]XU5nX4lU$�N)�super�__new__r-)�cls�failed�	attemptedr-�results�	__class__s     ��./opt/alt/python313/lib64/python3.13/doctest.pyr1�TestResults.__new__ps����'�/�#�y�9��!����c�>�UR(a*SURSURSURS3$[TU]5$)NzTestResults(failed=z, attempted=z
, skipped=�))r-r3r4r0�__repr__)�selfr6s �r7r<�TestResults.__repr__usN����<�<�)�$�+�+��7!�!%��� 0�1�#�|�|�n�A�/�
0��7�#�%�%r9�)�__name__�
__module__�__qualname__�__firstlineno__r1r<�__static_attributes__�
__classcell__)r6s@r7r*r*os���34���
&�&r9r*zfailed attemptedc�N�[RUS[[5-5$)N�)�OPTIONFLAGS_BY_NAME�
setdefault�len)�names r7rr�s ���)�)�$��S�9L�5M�0M�N�Nr9rrrrrrr
rrr
rz<BLANKLINE>z...c��Sn[RH8nURUS5nU[[U5LdM*XR-nM: U$�Nr#)�
__future__�all_feature_names�get�getattr�
compiler_flag)�globs�flags�fname�features    r7�_extract_future_flagsrW�sM��

�E��-�-���)�)�E�4�(���g�j�%�0�0��*�*�*�E�.��Lr9c��[R"U5(aU$[U[5(a[	U[5[
5S/5$Uc)[R[R"U5$[S5e![a7 [R[R"U5RSs$f=f![a gf=f)N�*r@z"Expected a module, string, or None)�inspect�ismodule�
isinstance�str�
__import__�globals�locals�sys�modules�_getframemodulename�AttributeError�	_getframe�	f_globals�KeyError�	TypeError)�module�depths  r7�_normalize_modulerk�s����������
�	�F�C�	 �	 ��&�'�)�V�X��u�=�=�	��	�
O��{�{�3�#:�#:�5�#A�B�B��<�=�=��"�
O��{�{�3�=�=��#7�#A�#A�*�#M�N�N�
O���	��	�s*�&B	�	>C
�C
�	C
�
C
�
C�Cc�:�[SS5RUS5$�NT)r%�decode)�datas r7�_newline_convertrp�s��$�T�4�0�7�7��d�C�Cr9c��U(a~[US5n[X5n[USS5=ncURRn[
US5(a/URU5nURU5n[U5U4$[XS9nUR5U4sSSS5 $![
a Nqf=f!,(df   g=f)N��
__loader__�get_data)�encoding)rk�_module_relative_pathrQ�__spec__�loaderrd�hasattrrtrnrp�open�read)�filename�package�module_relativerurx�
file_contents�fs       r7�_load_testfiler��s����#�G�Q�/��(��;���g�|�T�:�:�F�C�
� �)�)�0�0���6�:�&�&�"�O�O�H�5�M�)�0�0��:�M�$�M�2�H�<�<�	
�h�	*�a��v�v�x��!�
+�	*��"�
��
��
+�	*�s�B+�B;�+
B8�7B8�;
C	c�8�[R"SUS-U5$)Nz
(?m)^(?!$)� )�re�sub)�s�indents  r7�_indentr�s���6�6�,��s�
�A�.�.r9c�j�[5nUup#n[R"X#XAS9 UR5$)N)�file)r$�	traceback�print_exception�getvalue)�exc_info�excout�exc_type�exc_val�exc_tbs     r7�_exception_tracebackr�s2���Z�F� (��H�v�
���h��E��?�?��r9c�$�\rSrSrSrSSjrSrg)�	_SpoofOutic�v�[R"U5nU(aURS5(dUS-
nU$�N�
)r$r��endswith)r=�results  r7r��_SpoofOut.getvalues3���"�"�4�(���&�/�/�$�/�/��d�N�F��
r9Nc�R�URU5 [R"U5 gr/)�seekr$�truncate)r=�sizes  r7r��_SpoofOut.truncate"s���	�	�$�����$�r9r?r/)r@rArBrCr�r�rDr?r9r7r�r�s��� r9r�c��[U;aX:H$UR[5nS[U5pCUSnU(a&URU5(a[U5nUS	OgUSnU(a)UR	U5(aU[U5-nUS	OgX4:�agUH+nURXSU5nUS:a gU[U5-
nM- g)Nr#F���T)�ELLIPSIS_MARKER�splitrJ�
startswithr��find)�want�got�ws�startpos�endpos�ws      r7�_ellipsis_matchr�'s����d�"��{��
���O�	$�B��#�c�(�f�
�1��A���>�>�!����1�v�H��1���
�2��A���<�<��?�?��c�!�f��F��2������
���8�8�A��0���a�<���C��F����r9c�<�UR5nU(aSU-$g)Nz# �#)�rstrip)�lines r7�
_comment_liner�Xs���;�;�=�D���D�y��r9c���S[U5p!URS5nUS:�aUnURSSU5nUS:�aUnURSSU5nUS:�aUS-nXU$)Nr#r��:�.rG)rJr��rfind)�msg�start�end�is    r7�_strip_exception_detailsr�`sr���C��H�3������A��A�v�������a���A��A�v����	�	�#�q�#��A��A�v��!����c�?�r9c�0�\rSrSrSrSSjrSrSrSrg)	�_OutputRedirectingPdbizc�h�XlSUl[RR	XSS9 SUlg)NFT)�stdout�nosigintrG)�_OutputRedirectingPdb__out�$_OutputRedirectingPdb__debugger_used�pdb�Pdb�__init__�use_rawinput)r=�outs  r7r��_OutputRedirectingPdb.__init__�s.���
�$���������D��9���r9Nc��SUlUc[R"5Rn[R
R
X5 grm)r�rare�f_backr�r��	set_trace)r=�frames  r7r��_OutputRedirectingPdb.set_trace�s2��#����=��M�M�O�*�*�E������$�&r9c�f�UR(a [RRU5 ggr/)r�r�r��set_continue�r=s r7r��"_OutputRedirectingPdb.set_continue�s$������G�G� � ��&� r9c���[RnUR[l[RR
"U/UQ76U[l$!U[lf=fr/)rar�r�r�r��trace_dispatch)r=�args�save_stdouts   r7r��$_OutputRedirectingPdb.trace_dispatch�sA���j�j���Z�Z��
�	%��7�7�)�)�$�6��6�$�C�J���C�J�s� A�
A )�__debugger_used�__outr�r/)	r@rArBrCr�r�r�r�rDr?r9r7r�r�zs���'�'�%r9r�c���[R"U5(d[SU-5eURS5(a[	S5e[
RR"URS56n[US5(a.[
RRUR5SnGOURS:Xay[[R5S:�aK[RSS:wa4[
RR[RS5SnO�[
RnO�[US5(aZUR HJn[
RRX15n[
RR#U5(dMHUs $ [	S	UR-5e[
RRX!5$)
NzExpected a module: %r�/z1Module-relative files may not have absolute paths�__file__r#�__main__��__path__zBCan't resolve paths relative to the module %r (it has no __file__))rZr[rhr��
ValueError�os�path�joinr�ryr�r@rJra�argv�curdirr��exists)ri�	test_path�basedir�	directory�fullpaths     r7rvrv�sT�����F�#�#��/�&�8�9�9����C� � ��L�M�M������y���s�3�5�I��v�z�"�"��'�'�-�-����0��3��	���J�	&��s�x�x�=��?�s�x�x��{�b�0��g�g�m�m�C�H�H�Q�K�0��3�G��i�i�G��6�:�&�&�#�_�_�	��7�7�<�<�	�=���7�7�>�>�(�+�+�#�O�-��3�!�?�?�+�,�	,�
�7�7�<�<��+�+r9c�.�\rSrSrSSjrSrSrSrg)ri�Nc��URS5(dUS-
nU(aURS5(dUS-
nUbURS5(dUS-
nXlX lX@lXPlUc0nX`lX0lgr�)r��sourcer��linenor��options�exc_msg)r=r�r�r�r�r�r�s       r7r��Example.__init__�s|�����t�$�$��d�N�F���
�
�d�+�+��D�L�D���w�'7�'7��'=�'=��t�O�G����	������?�b�G����r9c��[U5[U5La[$URUR:H=(a� URUR:H=(ay URUR:H=(aY UR
UR
:H=(a9 URUR:H=(a URUR:H$r/)�type�NotImplementedr�r�r�r�r�r��r=�others  r7�__eq__�Example.__eq__s�����:�T�%�[�(�!�!��{�{�e�l�l�*�-��y�y�E�J�J�&�-��{�{�e�l�l�*�-��{�{�e�l�l�*�-��|�|�u�}�}�,�	-�
�|�|�u�}�}�,�	-r9c��[URURURURUR
45$r/)�hashr�r�r�r�r�r�s r7�__hash__�Example.__hash__
s3���T�[�[�$�)�)�T�[�[�$�+�+��\�\�#�$�	$r9)r�r�r�r�r�r�)Nr#r#N)r@rArBrCr�r�r�rDr?r9r7rr�s��FEF���$	-�$r9rc�2�\rSrSrSrSrSrSrSrSr	g)	ric�j�XlX`lUR5UlX0lX@lXPlgr/)�examples�	docstring�copyrSrKr|r�)r=r�rSrKr|r�r�s       r7r��DocTest.__init__)s*��!�
�"���Z�Z�\��
��	� �
��r9c�4�[UR5S:XaSnO4[UR5S:XaSnOS[UR5-nSURR<SUR<SUR
<S	UR<S
U<S3$)Nr#zno examplesrGz	1 examplez%d examples�<r�z from r�� (z)>)rJr�r6r@rKr|r�)r=r�s  r7r<�DocTest.__repr__7sp���t�}�}���"�$�H�
����
�1�
$�"�H�$�s�4�=�=�'9�9�H�����(�(����D�M�M�4�;�;��B�	Cr9c��[U5[U5La[$URUR:H=(a� URUR:H=(ay URUR:H=(aY UR
UR
:H=(a9 URUR:H=(a URUR:H$r/)r�r�r�r�rSrKr|r�r�s  r7r��DocTest.__eq__Bs�����:�T�%�[�(�!�!��}�}����.�+��~�~����0�+��z�z�U�[�[�(�+��y�y�E�J�J�&�+��}�}����.�	+�
�{�{�e�l�l�*�	+r9c�p�[URURURUR45$r/)r�r�rKr|r�r�s r7r��DocTest.__hash__Ms&���T�^�^�T�Y�Y��
�
�t�{�{�K�L�Lr9c�2�[U[5(d[$URbUROSnURbUROSnURUR
U[
U54URUR
U[
U54:$)Nr�)r\rr�r�rKr|�id)r=r��self_lno�	other_lnos    r7�__lt__�DocTest.__lt__Qsy���%��)�)�!�!�"&�+�+�"9�4�;�;�r��$)�L�L�$<�E�L�L�"�	����D�M�M�8�R��X�>����U�^�^�Y��5�	�B�C�	Dr9)r�r�r|rSr�rKN)
r@rArBrCr�r<r�r�rrDr?r9r7rrs��0�	C�	+�M�Dr9rc��\rSrSr\R
"S\R\R-5r\R
"S\R\R-\R-5r
\R
"S5RrSSjr
SrSSjrSr\R
"S	\R5rS
r\R
"S\R5rSrS
rSrSrg)ri^a�
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        a�
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$c��UR5nURU5nUS:�a3SRURS5Vs/sHoDUSPM	 sn5n/nSupgURRU5H�nUR
XUR55 XqRSXhR55-
nURX�U5up�p�URU	5(d7UR
[X�UUU[URS55-U
S95 XqRSUR5UR55-
nUR5nM� UR
XS5 U$s snf)Nr#r�)r#r#r�)r�r�r�)�
expandtabs�_min_indentr�r��_EXAMPLE_RE�finditer�appendr��count�_parse_example�_IS_BLANK_OR_COMMENTrrJ�groupr�)
r=�stringrK�
min_indent�l�output�charnor��mr�r�r�r�s
             r7�parse�DocTestParser.parse�sX���"�"�$���%�%�f�-�
���>��Y�Y����T�8J�K�8J�1�*�+��8J�K�L�F�������!�!�*�*�6�2�A��M�M�&����	�2�3��l�l�4�����;�;�F��(�(��&�9�
-�V�d��,�,�V�4�4��
�
�w�v�W�+1�+5�c�!�'�'�(�:K�6L�+L�,3� 5�7�

�l�l�4�����A�E�E�G�<�<�F��U�U�W�F�#3�&	�
�
�f�W�o�&��
��3 Ls�E>c�<�[URX5UX4XQ5$r/)r�get_examples)r=rrSrKr|r�s      r7�get_doctest�DocTestParser.get_doctest�s%���t�(�(��6���v�7�	7r9c�~�URX5Vs/sHn[U[5(dMUPM sn$s snfr/)r!r\r)r=rrK�xs    r7r$�DocTestParser.get_examples�s<�� �:�:�f�3�+�3�a��a��)��3�+�	+��+s�:�:c	��[URS55nURS5RS5nURXTX#5 UR	USSSU-S-X#5 SRUVs/sH
ofUS-SPM sn5nURS5nURS5n	[U	5S:�a"[R"S	U	S
5(aU	S
	UR	U	SU-UU[U5-5 SRU	V
s/sHo�USPM	 sn
5nURRU5nU(aURS5nOSnURXrU5nX|X�4$s snfs sn
f)Nr�r�r�rGr�r��r�z *$r�r�)
rJrr��_check_prompt_blank�
_check_prefixr�r��match�
_EXCEPTION_RE�
_find_options)
r=r rKr�r��source_lines�slr�r��
want_lines�wlr�r�s
             r7r�DocTestParser._parse_example�sj���Q�W�W�X�&�'���w�w�x�(�.�.�t�4��� � ��t�D����<���+�S��Z�#�-=�t�L����L�A�L�b�v�a�x�y�M�L�A�B��
�w�w�v����Z�Z��%�
��z�?�Q��2�8�8�F�J�r�N�#C�#C��2�����:�s�6�z�4�!�C��$5�5�	7��y�y�
�;�
�"�V�W�+�
�;�<��
���$�$�T�*����g�g�e�n�G��G��$�$�V�6�:����-�-��/B��<s�8E6�E;z#\s*doctest:\s*([^\n\'"]*)$c
��0nURRU5H�nURS5RSS5R	5nUHInUSS;d
USS[
;a[
SUS-<SU<SU<35e[
USSnUSS	:HXH'MK M� U(a-URU5(a[
SU<SU<S
U<35eU$)NrG�,r�r#z+-�line z of the doctest for z has an invalid option: �+z4 has an option directive on a line with no example: )�_OPTION_DIRECTIVE_RErr�replacer�rHr�r)	r=r�rKr�r�r �option_strings�option�flags	         r7r0�DocTestParser._find_optionss������*�*�3�3�F�;�A��W�W�Q�Z�/�/��S�9�?�?�A�N�(���1�I�T�)��1�2�J�&9�9�$�&,�Q�h��f�&>�?�?�+�6�!�"�:�6��!'���c�!1��
�)�<��t�0�0��8�8��$�d�F�4�5�
5��r9z
^([ ]*)(?=\S)c��URRU5Vs/sHn[U5PM nn[U5S:�a[U5$gs snfrM)�
_INDENT_RE�findallrJ�min)r=r�r��indentss    r7r�DocTestParser._min_indent#sJ��-1�_�_�-D�-D�Q�-G�H�-G�6�3�v�;�-G��H��w�<�!���w�<����	Is�Ac��[U5HIupV[U5US-:�dMXbS-S:wdM&[SXE-S-<SU<SXbUS-<SU<35e g)	Nr+rrr�r8rG� of the docstring for z lacks blank after z: )�	enumeraterJr�)r=�linesr�rKr�r�r�s       r7r,�!DocTestParser._check_prompt_blank+s_��!��'�G�A��4�y�F�1�H�$��Q�h��3�)>� �"(�(�1�*�d�"&�f�Q�h�"7��"?�@�@�(r9c	��[U5H@upVU(dMURU5(aM&[SXE-S-<SU<SU<35e g)Nr8rGrGz& has inconsistent leading whitespace: )rHr�r�)r=rI�prefixrKr�r�r�s       r7r-�DocTestParser._check_prefix9sG��
!��'�G�A��t�D�O�O�F�3�3� �"(�(�1�*�d�D�":�;�;�(r9r?N)z<string>)r@rArBrCr��compile�	MULTILINE�VERBOSEr�DOTALLr/r.rr!r%r$rr:r0rArr,r-rDr?r9r7rr^s����*�*���\�\�B�J�J�
&�(�K�,�J�J� ��Z�Z�"�,�,�
&����
2�4�M��:�:�o�6�<�<��%�N
7�+�*.�f�:�:�&D�&(�l�l�4���8���,�b�l�l�;�J��@�	;r9rc�X�\rSrSrS\"5SS4SjrS
SjrSrSrS	r	S
r
SrSrg)riIFTc�4�X lXlX0lX@lgr/)�_parser�_verbose�_recurse�_exclude_empty)r=�verbose�parser�recurse�
exclude_emptys     r7r��DocTestFinder.__init__Rs��"���
��
�+�r9Nc	���Uc([USS5nUc[S[U5<35eUSLaSnOUc[R"U5n[R
"U5nU(d'[R"U5nUSUSS-S:XdSnUcSnOCUb![R"XcR5nO[R"U5nU(dSnUc!Uc0nO+URR5nOUR5nUbURU5 SU;aSUS'/nURX�X#Xt05 UR5 U$![a SnN�f=f)Nr@zHDocTestFinder.find: name must be given when obj.__name__ doesn't exist: Fr#���z<]>r�)rQr�r�rZ�	getmodule�
getsourcefile�getfile�	linecache�getlines�__dict__rhr�update�_find�sort)	r=�objrKrirS�
extraglobsr�r1�testss	         r7r��DocTestFinder.findhsp��H�<��3�
�D�1�D��|� �"&�s�)�".�/�/��U�?��F�
�^��&�&�s�+�F�
	(��(�(��-�D�����s�+���A�w�t�B�C�y�(�E�1�$�4��|�#���%�$-�#5�#5�d�O�O�#L�L�$-�#5�#5�d�#;�L�#�#'�L��=��~������,�,�.���J�J�L�E��!��L�L��$��U�"� *�E�*�����
�
�5�t�\�"�E�
	�
�
�����Y�	 ��L�	 �s�E�E%�$E%c���Ucg[R"U5bU[R"U5L$[R"U5(aURURL$[R
"U5(d"U5(aV[US5(aURRnO[US5(a
URnOgURU:H$[R"U5(aURUR:H$[US5(aURUR:H$[U[5(ag[S5e)NT�__objclass__rAz"object must be a class or function)rZr_�
isfunctionrd�__globals__�ismethoddescriptor�ismethodwrapperryrmrAr@�isclassr\�propertyr�)r=ri�object�obj_mods    r7�_from_module�DocTestFinder._from_module�s%��
�>��
�
�
�v�
&�
2��W�.�.�v�6�6�6�
�
�
��
'�
'��?�?�f�&8�&8�8�8��(�(��0�0��%�%�f�-�-��v�~�.�.� �-�-�8�8�����.�.� �+�+����?�?�g�-�-�
�_�_�V�
$�
$��?�?�f�&7�&7�7�7�
�V�\�
*�
*��?�?�f�&7�&7�7�7�
���
)�
)���A�B�Br9c��Un[R"U5n[R"U5$![a N"f=fr/)rZ�unwrapr��	isroutine)r=rh�
maybe_routines   r7�_is_routine�DocTestFinder._is_routine�sC���
�	�#�N�N�=�9�M�� � ��/�/���	��	�s�0�
=�=c
�^�UR(a[SU-5 [U5U;agSU[U5'URX#XFU5nUbUR	U5 [
R"U5(a�UR(a�URR5Hmup�U<SU	<3n	URU
5(d[
R"U
5(dMAURXJ5(dMYURXX�UXg5 Mo [
R"U5(a�UR(a�[US05R5H�up�[U	[ 5(d[#S[%U	5<35e[
R&"U
5(dc[
R"U
5(dH[
R"U
5(d-[U
[ 5(d[#S[%U
5<35eU<SU	<3n	URXX�UXg5 M� [
R"U5(a�UR(a�URR5H�up�[U
[([*45(aU
R,n
[
R&"U
5(d2[
R"U
5(d[U
[.5(dMyURXJ5(dM�U<SU	<3n	URXX�UXg5 M� ggg)NzFinding tests in %srGr��__test__z3DocTestFinder.find: __test__ keys must be strings: z^DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: z
.__test__.)rU�printr�	_get_testrrZr[rVrd�itemsr|rrrvrfrQr\r]r�r�rz�staticmethod�classmethod�__func__rs)r=rjrhrKrir1rS�seen�test�valname�vals           r7rf�DocTestFinder._find�sh��
�=�=��'�$�.�/��c�7�d�?����R��W�
��~�~�c���E�����L�L������C� � �T�]�]� #��� 2� 2� 4���%)�7�3���%�%�c�*�*�g�o�o�c�.B�.B��%�%�f�2�2��J�J�u�7�L�$�,�
!5����C� � �T�]�]� '��Z�� <� B� B� D���!�'�3�/�/�$�&*�7�m�&6�7�7� �)�)�#�.�.�'�/�/�#�2F�2F��(�(��-�-��C��1E�1E�$�'+�3�i�&2�3�3�/3�G�<���
�
�5�w�� �(�!E� �?�?�3���D�M�M� #��� 2� 2� 4����c�L�+�#>�?�?��,�,�C��&�&�s�+�+�w���s�/C�/C� ��h�/�/��'�'��4�4�)-�w�7�G��J�J�u�7�L�$�,�!5�%2�r9c���[U[5(aUnO=URcSnO,URn[U[5(d[U5nURX5nUR(aU(dgUcSnO.[USS5=(d URnUSSS:XaUSSnURRXdUX�5$![[4a SnN�f=f)Nr�r�����.pycr�)r\r]�__doc__rhrd�_find_linenorWrQr@rTr%)	r=rhrKrirSr1r�r�r|s	         r7r��DocTestFinder._get_test3s����c�3����I�
��;�;�&� "�I� #���I�%�i��5�5�$'�	�N�	�
�"�"�3�5�����y���>��H��v�z�4�8�K�F�O�O�H����}��&�#�C�R�=���|�|�'�'�	�$�(0�:�	:��%�~�.�
��	�
�s�C�,C�C&�%C&c
�d�Sn[USS5n[R"U5(aUbSn[R"U5(amUbjUcg[R
"S[R"[USS55-5n[U5HupgURU5(dMUn O [R"U5(aURn[U[5(aURn[R"U5(a5[USS5(a#[R"U5nUR n[R$"U5(aUR&n[R("U5(aUR*n[R,"U5(aUR.S-
nUbVUcUS-$[R
"S5n[1U[3U55HnURX#5(dMUs $ g!["a gf=f)Nr�r#z^\s*class\s*%s\br@�-rGz(^|.*:)\s*\w*("|\'))rQrZr[rrr�rN�escaperHr.�ismethodr�r\rs�fgetrnry�__code__rd�istraceback�tb_frame�isframe�f_code�iscode�co_firstlineno�rangerJ)r=rhr1r�r��patr�r�s        r7r��DocTestFinder._find_linenoYs������C��D�1�	����C� � �Y�%:��F�
�?�?�3���I�$9��#���*�*�0��Y�Y�w�s�J��'D�E�F�G�C�$�\�2����9�9�T�?�?��F��3����C� � ����#��c�8�$�$��(�(�C����c�"�"�w�s�I�t�'D�'D��.�.��%�C�
��l�l�����s�#�#�3�<�<�S��?�?�3���s�z�z���>�>�#����'�'�!�+�F����#��a�x���*�*�3�4�C����L�(9�:���9�9�\�1�2�2�!�M�;�
��1"�
��	
�s�H"�"
H/�.H/)rWrTrVrU�NNNN)
r@rArBrCrr�r�rvr|rfr�r�rDr?r9r7rrIs8�� %�]�_��T�,�,d�LC�:	0�;,�z$:�L;r9rc��\rSrSrSrSSjrSrSrSrSr	S	r
S
rSr\
R"S5rSS
jrSSjrSSjrSrSrg)ri�zF**********************************************************************Nc���U=(d
 [5UlUcS[R;nX lX0lX0lSUlSUlSUl	0Ul
[5Ulg)N�-vr#)
r�_checkerrar�rU�optionflags�original_optionflags�tries�failures�skips�_statsr��_fakeout)r=�checkerrXr�s    r7r��DocTestRunner.__init__�s_��" �2�=�?��
��?��c�h�h�&�G��
�&��$/�!���
���
���
����"���
r9c��UR(akUR(a8U"S[UR5-S-[UR5-5 gU"S[UR5-S-5 gg)NzTrying:
zExpecting:
zExpecting nothing
)rUr�r�r�)r=r�r��examples    r7�report_start�DocTestRunner.report_startsj��
�=�=��|�|��K�'�'�.�.�"9�9�"�#�%,�W�\�\�%:�;�<��K�'�'�.�.�"9�9�)�*�+�r9c�8�UR(a	U"S5 gg)Nzok
)rU�r=r�r�r�r�s     r7�report_success�DocTestRunner.report_successs��
�=�=���K�r9c��U"URX#5URRX4UR5-5 gr/)�_failure_headerr��output_differencer�r�s     r7�report_failure�DocTestRunner.report_failures:��	�D� � ��/��M�M�+�+�G�$�:J�:J�K�
L�	Mr9c�b�U"URX#5S-[[U55-5 g)NzException raised:
)r�r�r��r=r�r�r�r�s     r7�report_unexpected_exception�)DocTestRunner.report_unexpected_exceptions6��	�D� � ��/�!�
"�$+�,@��,J�$K�
L�	Mr9c�v�[5(a [R[R4OSup4UURU3/nUR
(akURb*URbURUR-S-nOSnURSUR
<SU<SUR<35 O0URSURS-<SUR<35 URS5 URnUR[U55 S	RU5$)
N)r�r�rG�?zFile "�", line �, in zLine zFailed example:r�)r(r'�RED�RESET�DIVIDERr|r�rrKr�r�r�)r=r�r��red�resetr�r�r�s        r7r��DocTestRunner._failure_header$s���2>�.�.�Z�^�^�Z�-�-�.�h�	����t�|�|�n�U�G�,�-���=�=��{�{�&�7�>�>�+E����w�~�~�5��9�����J�J��
�
�v�t�y�y�:�
;�
�J�J�7�>�>�!�+;�T�Y�Y�G�H��
�
�$�%������
�
�7�6�?�#��y�y��~�r9c
�^�S=n=pVURn[S5up�n
URRn[	UR
5GHJup�US-
nUR[-=(a US:�nXplU
R(aXU
RR5H:unnU(aU=RU-slM$U=RU)-slM< UR[-(aUS-
nM�U(dURX1U
5 SURU4-n[[U
RUSUS5UR5 UR R#5 SnUR*R-5nUR*R/S5 U	nUc'U"U
R0UUR5(aUnGO0[2R4"USS6n[7US[85(aWUSR:S3USR<S	USR:S34m[?U4S
j[	U555nUUSnSRAU5nU(dU[CU5-
nU
RDcU
nOuU"U
RDUUR5(aUnOOUR[F-(a7U"[IU
RD5[IU5UR5(aUnUULaU(dURKX1U
U5 OIUU	La U(dURMX1U
U5 US-
nO$UU
LaU(dUROX1U
U5 US-
nU(dGM0UR[P-(dGMK O XplURSXXV5 [UXEUS9$![$a e [&R("5nUR R#5 GN�=f)
Nr#rrrGz<doctest %s[%d]>�singleT�r�r�c3�\># �UH!upURT5(dMUv� M# g7fr/)r�)�.0�indexr��exception_line_prefixess   �r7�	<genexpr>�&DocTestRunner.__run.<locals>.<genexpr>�s)����)�+B�K�E��?�?�+B�C���+B�s�,�	,r�r,)+r�r�r��check_outputrHr�r
r�r�rr�rK�execrNr�rS�debuggerr��KeyboardInterruptrar�r�r�r�r�r��format_exception_only�
issubclass�SyntaxErrorrBrA�nextr�r�r�rr�r�r�r�r�_DocTestRunner__record_outcomer*)r=r��compileflagsr�r�r4r�r��SUCCESS�FAILURE�BOOM�check�
examplenumr��quiet�
optionflagr�r|�	exceptionr��outcome�formatted_ex�
exc_msg_indexr�r�s                        @r7�__run�DocTestRunner.__run;s����()�(��(�9� $�/�/��!&�q����$��
�
�*�*��$-�T�]�]�#;��J���N�I��%�%�(A�A�"���\�
� 4�����)0���)>�)>�)@�%�Z����(�(�J�6�(��(�(�Z�K�7�(�	*A����$�&���
�����!�!�#�W�5�
*�T�Y�Y�
�,C�C�H�


-��W�W�^�^�X�x�)�4�1�26�*�*�>��
�
�*�*�,� �	��-�-�(�(�*�C��M�M�"�"�1�%��G�� �����s�D�,<�,<�=�=�%�G�� )�>�>�	�"�1�
�N���i��l�K�8�8�%�Q�<�4�4�5�Q�7�$�Q�<�2�2�3�1�Y�q�\�5N�5N�4O�q�Q�/�+�%)�)�+4�\�+B�)�%�M�
$0�
��#?�L��'�'�,�/����/�	�:�:�C��?�?�*�"�G��7�?�?�G�T�5E�5E�F�F�%�G��%�%�(?�?��5�g�o�o�F�5�g�>�!�-�-�/�/�#*���'�!���'�'��7�C�@���G�#���'�'��7�C�@��A�
���D����4�4�S��5>�@��A�
���x�D�,�,�y�8�8��a$<�f0��	
���d�i�?��8��>�>��_%�
��
-��L�L�N�	��
�
�*�*�,�s
�/A	N=�=;O;c��URRURS5upVnX%-X6-XG-4URUR'U=RU-
slU=RU-
slU=R
U-
slg)N)r#r#r#)r�rPrKr�r�r�)r=r�r�r�r��	failures2�tries2�skips2s        r7�__record_outcome�DocTestRunner.__record_outcome�sq��
%)�K�K�O�O�D�I�I�y�$I�!�	�6�"*�"6�"'�.�"'�.�"2����D�I�I��	
�
�
��!�
��
�
�e��
��
�
�e��
r9z.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$c�N�URRU5nU(asURS5URR:XaJURR
[
URS55nURRSS9$URX5$)NrKr�T��keepends)
�%_DocTestRunner__LINECACHE_FILENAME_REr.rr�rKr��intr��
splitlines�save_linecache_getlines)r=r|�module_globalsr r�s     r7�__patched_linecache_getlines�*DocTestRunner.__patched_linecache_getlines�s}���(�(�.�.�x�8��������D�I�I�N�N�2��i�i�(�(��Q�W�W�\�-B�)C�D�G��>�>�,�,�d�,�;�;��/�/��I�Ir9c�^
^�XlUc[UR5n[RmUc7TR
m
T
bT
R
5S:Xa
TRnOU
U4SjnUR[l[R"5n[Rn[T5Ul
URR5 URR[l[R UlUR$[l[R&n[R([l[*R,nS[*lSSS.n	U	H%n
[.R0R3U
S5X�'M' UR5XU5T[lU[l[R6"U5 UR"[lU[lU[*lU	R95Hup�UcM
U[.R0U
'M U(a&URR;5 SSKnSUl$$!T[lU[l[R6"U5 UR"[lU[lU[*lU	R95Hup�UcM
U[.R0U
'M U(a&URR;5 SSKnSUlff=f)N�utf-8c�`>�[URTS5T5nTRU5 g)N�backslashreplace)r]�encode�write)r�rur�s ��r7r��DocTestRunner.run.<locals>.outs)����A�H�H�X�/A�B�H�M�A��%�%�a�(r9c��g�NFr?r?r9r7�<lambda>�#DocTestRunner.run.<locals>.<lambda>s��r9)�
PYTHON_COLORS�FORCE_COLORr#) r�rWrSrar�ru�lowerr�r��gettracer�r�r�r�r�rbrcr��*_DocTestRunner__patched_linecache_getlines�displayhook�__displayhook__�	_colorizer(r��environ�pop�_DocTestRunner__run�settracer��clear�builtins�_)r=r�r�r��clear_globs�
save_trace�save_set_trace�save_displayhook�saved_can_colorize�color_variables�key�valuerrur�s             @@r7�run�DocTestRunner.run�s>���(�	���0����<�L��j�j���;�"�+�+�H���8�>�>�#3�w�#>�!�'�'��)��]�]��
��\�\�^�
�����-�k�:��
��
�
�����
�
�/�/��
�(1�'9�'9��$�!�>�>�	���?�?���-�-���&�3�3��!.�	��,0��F��"�C�#%�:�:�>�>�#�t�#<�O� �#�	"��:�:�d�#�6�$�C�J�*�C�M��L�L��$�!%�!=�!=�I��.�C�O�%7�I�"�-�3�3�5�
���$�&+�B�J�J�s�O�6���
�
� � �"��!��
���%�C�J�*�C�M��L�L��$�!%�!=�!=�I��.�C�O�%7�I�"�-�3�3�5�
���$�&+�B�J�J�s�O�6���
�
� � �"��!��
��s�I�A.L�ALc��UcURn///pCnS=n=pgURR5H\unup�nXZ-
nXi-
nX{-
nU
S:XaURU5 M.U	S:XaURX�45 MHURX�X�445 M^ [R
"5nURn
URnURnURnURnURnU(a�U(a>[[U5S35 UR5 UHn[SU35 M U(aS[U[U5SU35 [U5H)unnUS:XaSOSn[SUUS	S
USUU35 M+ U(a`[UUR U35 [[U5S35 [U5Hunup�n[SU	S	S
U
S	SU35 M! U(a[US:XaSOSn[US
US[UR5S35 U(a
SUUSU3OSn[UXV-
SUUS35 U(aDUS:XaSOSnUSUSUU3nU(aUS:XaSOSnUSUUSUU3n[US35 OU(a[U
SU35 [#XeUS9$)Nr#z had no tests:z    z passed all tests:rGr�r�r��3dz testz in z had failures:z of r�z and z failedz passedz***Test Failed*** z failurez
 skipped testzTest passed.r,)rUr�r�rr�
get_colors�
BOLD_GREEN�BOLD_RED�GREENr�r��YELLOWr��_n_itemsrg�sortedr�r*)r=rX�notests�passedr3�total_tries�total_failures�total_skipsrKr�r�r��ansi�
bold_green�bold_red�greenr�r��yellowrr��and_fr�s                       r7�	summarize�DocTestRunner.summarize1s���?��m�m�G�"$�b�"���56�6��6�n�.2�k�k�.?�.?�.A�*�D�*�8�E�� �K��&�N�� �K���z����t�$��Q���
�
�t�m�,��
�
�t��%=�>�?�/B��#�#�%���_�_�
��=�=���
�
���h�h���
�
����������'�*�+�>�:�;�����#�D��D���-�(�$������� 0�1�1C�E�7�K�L�#)�&�>�K�D�%�#�q�j��c�A��A�e�W�U�2�J�e�A�3�d�4�&���H�I�$2���S�E�$�,�,���w�/�0��X�f�%�&�n�5�6�28��.�.��.�x����(�2��d�5��*�D���?�@�3A��!�Q�&��C�A��[�M��q�c��h�t�{�{�.C�-D�A�F�G�"���u�^�,�G�E�7�;�')�
�
�U�G�K�8�9�����w�a�P�Q��$��)��s�A��J�0��0@����E�7�S�C��%��*�B�����U�6�(�;�-�}�Q�C��w�O���S�E��)��
��Z�L��U�G�4�5��>��L�Lr9c��URnURR5H'unupEnX2;aX#upxn	XG-nXX-nXi-nXEU4X#'M) gr/)r�r�)
r=r��drKr�r�r�r�r�r�s
          r7�merge�DocTestRunner.merge�s`���K�K��.3�l�l�.@�.@�.B�*�D�*�8�E��y�,-�G�)�	�6�#�/����������.�A�G�
/Cr9)r�r�r�rUr�r�r�r�r�r�r�r�)NNr#r/�NNT)r@rArBrCr�r�r�r�r�r�r�rr�r�rNr�rrr1r5rDr?r9r7rr�si��@�G�$�J+��M�M��.K?�Z�!�j�j�*F�G��J�L"�bKM�`/r9rr��returnc�:�[U5nUS:XaSOSnUSU3$)NrGr�r�z item)rJ)r��nr�s   r7r$r$�s*��	�E�
�A��1�f��#�A��S��a�S�>�r9c�,�\rSrSrSrSrSrSrSrg)ri�c�:�[URSS5S5$)N�ASCIIr�)r]r�)r=r�s  r7�_toAscii�OutputChecker._toAscii�s���1�8�8�G�%7�8�'�B�Br9c�0�URU5nURU5nX!:XagU[-(dX!4S:XagX!4S:XagU[-(dQ[R"S[R
"[5-SU5n[R"SSU5nX!:XagU[-(aDSRUR55nSRUR55nX!:XagU[-(a[X5(agg)	NT)zTrue
z1
)zFalse
z0
z(?m)^%s\s*?$r�z(?m)^[^\S\n]+$r�F)r>rrr�r�r��BLANKLINE_MARKERrr�r�rr��r=r�r�r�s    r7r��OutputChecker.check_output�s��� �m�m�C� ���}�}�T�"���;���4�4��z�.�.���z�/�/���3�3��6�6�/�B�I�I�6F�,G�G��d�$�D��&�&�*�B��4�C��{��
�-�-��(�(�3�9�9�;�'�C��8�8�D�J�J�L�)�D��{����!��t�)�)��r9c��U[[-[--(dgU[-(agURS5S:�=(a URS5S:�$)NFTr�r�)r
rrrrBs    r7�_do_a_fancy_diff�OutputChecker._do_a_fancy_diff�sV���l�*�+�*�+�,����%���z�z�$��!�#�;��	�	�$��!�(;�;r9c�*�URnU[-(d[R"S[U5nURXBU5(a�UR
SS9nUR
SS9nU[-(a&[R"XVSS9n[U5SSnSnO�U[-(a&[R"XVSS9n[U5SSnSnOLU[-(a>[R"[RS9n	[U	R!XV55nS	nS
W-[#SR%W55-$U(a#U(aS[#U5<S
[#U5<3$U(aS[#U5-$U(aS[#U5-$g)Nz(?m)^[ ]*(?=
)Tr�r�)r:z#unified diff with -expected +actualz-context diff with expected followed by actual)�charjunkzndiff with -expected +actualzDifferences (%s):
r�z
Expected:
zGot:
zExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)r�rr�r�rArEr�r
�difflib�unified_diff�listr�context_diffr�Differ�IS_CHARACTER_JUNK�comparer�r�)
r=r�r�r�r�r3�	got_lines�diff�kind�engines
          r7r��OutputChecker.output_difference�sQ���|�|���3�3��&�&�*�,<�c�B�C�� � ��K�8�8����$��7�J������5�I��\�)��+�+�J�Q�G���D�z�!�"�~��<���|�+��+�+�J�Q�G���D�z�!�"�~��F���|�+� ����1J�1J�K���F�N�N�:�A�B��5��)�4�/�'�"�'�'�$�-�2H�H�H��C�.5�d�m�W�S�\�J�J�
�/�'�$�-�?�?�
�/�'�#�,�>�>�4r9r?N)	r@rArBrCr>r�rEr�rDr?r9r7rr�s��C�<�~<�.,5r9rc� �\rSrSrSrSrSrg)ri'c�(�XlX lX0lgr/)r�r�r�)r=r�r�r�s    r7r��DocTestFailure.__init__2s���	����r9c�,�[UR5$r/�r]r�r�s r7�__str__�DocTestFailure.__str__7����4�9�9�~�r9)r�r�r�N�r@rArBrCr�rZrDr?r9r7rr's���
r9rc� �\rSrSrSrSrSrg)ri:c�(�XlX lX0lgr/)r�r�r�)r=r�r�r�s    r7r��UnexpectedException.__init__Es���	��� �
r9c�,�[UR5$r/rYr�s r7rZ�UnexpectedException.__str__Jr\r9)r�r�r�Nr]r?r9r7rr:s��!�
r9rc�*�\rSrSrSSjrSrSrSrg)riMNc�v�[RXX#S5nU(aURR5 U$r)rrrSr)r=r�r�r�r�rs      r7r�DebugRunner.run�s.�����d�,�U�C����J�J�����r9c��[X#U5er/)rr�s     r7r��'DebugRunner.report_unexpected_exception�s��!�$��:�:r9c��[X#U5er/)rr�s     r7r��DebugRunner.report_failure�s���T�C�0�0r9r?r7)r@rArBrCrr�r�rDr?r9r7rrMs��v�;�1r9rTFc	��Uc[RRS5n[R"U5(d[SU<35eUcURn[US9n	U(a
[X5S9n
O	[X5S9n
U	RXX&S9HnU
RU5 M U(aU
R5 [cU
q
O[RU
5 [U
R U
R"U
R$S9$)Nr�ztestmod: module required; )r[�rXr��rSrir,)rarbrPrZr[rhr@rrrr�rr1�masterr5r*r�r�r�)r rKrSrX�reportr�ri�raise_on_errorr[�finder�runnerr�s            r7rr�s���J	�y�
�K�K�O�O�J�'�����A����!�=�>�>��|��z�z����
7�F���W�F���w�H�����A�5��H���
�
�4��I������
�~������V���v������f�l�l�K�Kr9c�L�U(aU(d[S5e[XUU=(d S5up�Uc[RR	U5nUc0nOUR5nUbUR
U5 SU;aSUS'U	(a
[XWS9n
O	[XWS9n
U
RX�X S5nU
RU5 U(aU
R5 [cU
qO[RU
5 [U
RU
R U
R"S9$)N�8Package may only be specified for module-relative paths.r�r@r�rlr#r,)r�r�r�r��basenamerrerrr%rr1rnr5r*r�r�r�)r|r~rKr}rSrXror�rirprYru�textrrr�s               r7rr&s��d���+�,�	,�$�H��$,�$7��9�N�D��|��w�w����)��
�}����
�
�����
���Z� ����&��j����W�F���w�H�����d�4�1�=�D�
�J�J�t��
�����
�~������V���v������f�l�l�K�Kr9c�v�[USS9n[X%S9nURXUS9HnURX�S9 M g)NF)rXrZrl)rS)r�)rrr�r)	r�rSrXrKr�r�rqrrr�s	         r7rr�s?��$�7�E�
:�F�
�7�
D�F����A�5��1���
�
�4�
�3�2r9c�H�U[-U:wa[SU5e[nUqU$)NzOnly reporting flags allowed)rr��_unittest_reportflags)rT�olds  r7rr�s/��:	���E�)��7��?�?�
�C�!���Jr9c�v�\rSrSrSSjrSrSrSrSrSr	S	r
S
rSrSr
\RrS
rSrg)�DocTestCasei�Nc�~�[RRU5 X lXPlXlX0lX@lgr/)�unittest�TestCaser��_dt_optionflags�_dt_checker�_dt_test�	_dt_setUp�_dt_tearDown)r=r�r��setUp�tearDownr�s      r7r��DocTestCase.__init__�s4��	���"�"�4�(�*��"���
���$�r9c��URnURR5UlURbUR	U5 ggr/)r�rSr�	_dt_globsr��r=r�s  r7r��DocTestCase.setUp�s8���}�}�������*����>�>�%��N�N�4� �&r9c���URnURbURU5 URR5 URR	UR
5 gr/)r�r�rSrrer�r�s  r7r��DocTestCase.tearDown�sM���}�}�����(����d�#�	
�
�
�����
�
���$�.�.�)r9c��URn[Rn[5nURnU[
-(d	U[-n[UURSS9nSUl	URXRSS9nURUR:Xa[R"S5eU[lUR (a.UR#UR%UR'555eg!U[lf=f)NF�r�r�rXzF----------------------------------------------------------------------)r�rzall examples were skipped)r�rar�r$r�rryrr�r�rr�r-r4r~�SkipTestr3�failureException�format_failurer�)r=r�rz�newr�rrr5s       r7�runTest�DocTestCase.runTest	s����}�}���j�j���j���*�*���o�-�
�0�0�K��;�'+�'7�'7��H��	�#�F�N��j�j��9�9�%�j�H�G����'�"3�"3�3��'�'�(C�D�D�4��C�J��>�>��'�'��(;�(;�C�L�L�N�(K�L�L����C�J�s
� AC=�=
D
c
��URnURcSnOSUR-nSRURR	S5SS5nSUR<SUR
<SU<SU<S	U<3
$)
Nzunknown line numberz%sr�r��Failed doctest test for �	
  File "r�r�z

)r�r�r�rKr�r|)r=�errr�r��lnames     r7r��DocTestCase.format_failure	sj���}�}���;�;��*�F��D�K�K�'�F����������-�b�c�2�3���9�9�d�m�m�V�U�C�A�	r9c��UR5 [URURSS9nUR	UR
SS9 UR
5 g)NFr�)r)r�rr�r�rr�r�)r=rrs  r7r"�DocTestCase.debug%	sI��D	
�
�
����)=�)=�%)�%5�%5�u�F���
�
�4�=�=�e�
�4��
�
�r9c�.�URR$r/�r�rKr�s r7r�DocTestCase.idm	s���}�}�!�!�!r9c�n�[U5[U5La[$URUR:H=(ay URUR:H=(aY URUR:H=(a9 UR
UR
:H=(a URUR:H$r/)r�r�r�r�r�r�r�r�s  r7r��DocTestCase.__eq__p	s�����:�T�%�[�(�!�!��}�}����.�5��#�#�u�'<�'<�<�5��~�~����0�5�� � �E�$6�$6�6�5����5�#4�#4�4�		5r9c�p�[URURURUR45$r/)r�r�r�r�r�r�s r7r��DocTestCase.__hash__z	s3���T�)�)�4�>�>�4�;L�;L��%�%�'�(�	(r9c��URRRS5nUS<SSRUSS5<S3$)Nr�r�rr;)r�rKr�r�)r=rKs  r7r<�DocTestCase.__repr__~	s:���}�}�!�!�'�'��,�� ��H�c�h�h�t�C�R�y�&9�:�:r9c�4�SURR-$)Nz	Doctest: r�r�s r7�shortDescription�DocTestCase.shortDescription�	s���T�]�]�/�/�/�/r9)r�r�r�r�r�r�)r#NNN)r@rArBrCr�r�r�r�r�r"rr�r�r<rtrZr�rDr?r9r7r|r|�sM��AE��%�!�*�M�2
�F�P"�5�(�;��n�n�G�0r9r|c�0�\rSrSrSrSrSrSr\rSr	g)�SkipDocTestCasei�	c�<�Xl[RUS5 gr/)rir|r�)r=ris  r7r��SkipDocTestCase.__init__�	s�������T�4�(r9c�&�URS5 g)Nz-DocTestSuite will not work with -O2 and above)�skipTestr�s r7r��SkipDocTestCase.setUp�	s���
�
�E�Fr9c��gr/r?r�s r7�	test_skip�SkipDocTestCase.test_skip�	���r9c�4�SURR-$)NzSkipping tests from %s)rir@r�s r7r�� SkipDocTestCase.shortDescription�	s��'�$�+�+�*>�*>�>�>r9)riN)
r@rArBrCr�r�r�r�rZrDr?r9r7r�r��	s��)�G�
�?��Gr9r�c��\rSrSrSrSrg)�
_DocTestSuitei�	c��gr/r?)r=r�s  r7�_removeTestAtIndex� _DocTestSuite._removeTestAtIndex�	r�r9r?N)r@rArBrCr�rDr?r9r7r�r��	s��
r9r�c��Uc
[5n[U5nURXUS9nU(dD[RR
S:�a&[
5nUR[U55 U$UR5 [
5nUHjn[UR5S:XaMUR(d URnUSSS:XaUSSnX�lUR[U40UD65 Ml U$)Nrmr�r#r�r�r�)rrkr�rarT�optimizer��addTestr�rgrJr�r|r�r|)	rirSri�test_finderr�rj�suiter�r|s	         r7rr�	s���J��#�o��
�v�
&�F����V�Z��H�E��S�Y�Y�'�'�!�+����
�
�
�o�f�-�.���	�J�J�L��O�E����t�}�}���"���}�}����H����}��&�#�C�R�=��$�M�
�
�
�k�$�2�'�2�3���Lr9c�&�\rSrSrSrSrSrSrg)�DocFileCasei�	c�j�SRURRRS55$)Nrr�)r�r�rKr�r�s r7r�DocFileCase.id�	s&���x�x��
�
�*�*�0�0��5�6�6r9c�.�URR$r/)r�r|r�s r7r<�DocFileCase.__repr__�	s���}�}�%�%�%r9c�n�SURR<SURR<SU<3$)Nr�r�z", line 0

)r�rKr|)r=r�s  r7r��DocFileCase.format_failure�	s(���=�=�%�%�t�}�}�'=�'=�s�D�	r9r?N)r@rArBrCrr<r�rDr?r9r7r�r��	s��7�&�r9r�c� �Uc0nOUR5nU(aU(d[S5e[XUU=(d S5uppSU;aXS'[RRU5nUR
XsX�S5n	[U	40UD6$)Nrtr�r�r#)rr�r�r�r�rur%r�)
r�r~r}rSrYrur��docrKr�s
          r7�DocFileTestr��	s���
�}����
�
������+�,�	,��t�o�'�2�7�4�I�C���� �j���7�7���D�!�D����c�$�a�8�D��t�'�w�'�'r9c���[5nURSS5(a[URS55US'UHnUR[	U40UD65 M  U$)Nr~Tr})r�rPrkr�r�)�paths�kwr�r�s    r7rr
s^��p
�O�E�

�v�v���&�&�)�"�&�&��*;�<��9�
���
�
�
�k�$�-�"�-�.���Lr9c��/n[5RU5H�n[U[5(apUR	UR
SS5 URnU(a=UR	S5 XRS5SSVs/sHnSU-PM
 sn-
nM�M�UURS5SSVs/sHn[U5PM sn-
nM� U(a+USS:Xa"UR5 U(aUSS:XaM"U(a,USS:Xa#URS5 U(aUSS:XaM#SRU5S-$s snfs snf)Nr�z# Expected:r�z## r�r#)rr!r\rrr�r�r�r�r
r�)r�r�piecer�rs     r7rrN
s>��t�F���&�&�q�)���e�W�%�%��M�M�%�,�,�s��+�,��:�:�D���
�
�m�,��J�J�t�,<�S�b�,A�B�,A�q�5��7�,A�B�B���

� %���D� 1�#�2� 6�8� 6�1�%�Q�'� 6�8�
8�F�*��V�B�Z�3�&��
�
���V�B�Z�3�&�
�V�A�Y�#�%��
�
�1�
��V�A�Y�#�%��9�9�V��t�#�#��C��8s�E�;Ec��[U5n[5RU5nUVs/sHo3RU:XdMUPM nnU(d[	US5eUSn[UR5nU$s snf)Nznot found in testsr#)rkrr�rKr�rr�)rirKrj�tr��testsrcs      r7r r �
sn���v�
&�F��O� � ��(�E��/�u�!���$��A�u�D�/����3�4�4���7�D�"�4�>�>�2�G��N��0s�A7�A7c�2�[U5n[X1U5 gr/)r�debug_script)�src�pmrSr�s    r7r!r!�
s��"�3�'�G���e�$r9c��SSKnU(aUR5nO0nU(a[XU5 gUR"SS9RSU-X"5 g! [[R
"5S5 UR"SS9nUR5 URS[R
"5S5 g=f)Nr#rGT)r�r�zexec(%r))
r�rr�r�rar�r�r��interactionr)r�r�rSr��ps     r7r�r��
s������
�
�����	�	3���U�#�	�����"�"�:��#3�U�B��
	3��#�,�,�.��#�$�����&�A�
�G�G�I�
�M�M�$�����q� 1�2�s�A�A+Cc�\�[U5n[X5n[X2UR5 gr/)rkr r�rd)rirKr�r�s    r7r"r"�
s&���v�
&�F���&�G���f�o�o�.r9c�&�\rSrSrSrSrSrSrg)�
_TestClassi�
c��Xlgr/�r�)r=r�s  r7r��_TestClass.__init__�
s	���r9c�.�URS-UlU$)Nr�r�r�s r7�square�_TestClass.square�
s���8�8�q�=����r9c��UR$r/r�r�s r7rP�_TestClass.get�
s
���x�x�r9r�N)r@rArBrCr�r�rPrDr?r9r7r�r��
s����r9r�z�
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      a�
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    z�
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            z�
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            a�
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            )r�rzbool-int equivalencezblank lines�ellipsiszwhitespace normalizationc	���SSKnURSS9nURSSSSSS	9 URS
SS[R	5/S
S9 URSSSSS9 URSSSS9 UR5nURnURnSnURHnU[U-nM UR(a	U[-nUH�nURS5(am[RRU5up�[RR!SU5 [#USS5n	[RS	[%X�US9up�O
['USXES9up�U
(dM� g g)Nr#zdoctest runner)�descriptionr�z	--verbose�
store_trueFz'print very verbose output for all tests)�action�default�helpz-oz--optionrzqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r��choicesr�r�z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r�r�r�r9z file containing the tests to run)�nargsr�z.py���rl)r~rXr�rG)�argparse�ArgumentParser�add_argumentrH�keys�
parse_argsr�rXr=�	fail_fastrr�r�r�r�ra�insertr^rr)r�rYr��	testfilesrXr�r=r|�dirnamer r�rs            r7�_testr�6s����
�
$�
$�1A�
$�
B�F�
����k�,��F��H�
����j�� 3� 8� 8� :�B�E��G�
����m�L�F��H�����c�?��A�����D��	�	�I��l�l�G��G��+�+���&�v�.�.����~�~��9��������U�#�#�!#���
�
�h� 7��G��H�H�O�O�A�w�'��8�C�R�=�)�A������!�!�'�J�K�H�a�"�8�U�-4�K�K�H��8���
r9r�)r�)r+)	NNNNTr#NFF)F�NoNameNr#r�)FN)F)Z�
__docformat__�__all__rNrIrZrbr�r�r�rar�r~�ior$r%�collectionsr&rr'r(r*rHrrrrrrrr	r
rrr
rrrAr�rWrkrpr�r�r�r�r�r�r�r�r�rvrrrrrrK�dictr]r$r�	Exceptionrrrrnrrrryrrr|r��	TestSuiter�rr�r�rrr r!r�r"r�rr�r@�exitr?r9r7�<module>rsW��`&�
�+��Z����	�
�	�
���2�"��.�&�*�]�,>�?�&�L��O�-�-E�F��+�,C�D��*�+A�B���z�*���6�"��-�.G�H��*�)�*�(�)����	�
,�,��#�>�2��"�>�2��"�>�2��/�0K�L����,�	��� �� �-�-��	��!����&
�>�2D�"�$/�	� �� �/�b��4"%�C�G�G�"%�J ,�\B$�B$�HGD�GD�Zd;�d;�VK�K�b
o/�o/�d�D�4�K��C��P5�P5�d�Y��&�)��&e1�-�e1�\
��37�37�05�fL�R(,�$����d���U�=�?��yL�x:B�:;�4�6��!�Hb0�(�#�#�b0�H�k��"
�H�&�&�
�>�@�+��'+�D��=�?��(�4C�RP$�d� %�
C�(	/�*�*�X%��%(� ��)�Q0
��f*
�Z�z���H�H�U�W��r9

?>