Your IP : 216.73.216.213


Current Path : /opt/alt/python311/lib64/python3.11/test/test_pydoc/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/test/test_pydoc/__pycache__/test_pydoc.cpython-311.opt-2.pyc

�

�0�iQ��*�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZmZddlm Z ddlm!Z!ddlm"Z"ddl#m$Z$m%Z%m&Z&dd	lm'Z'dd
lm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ddl0m1Z1m2Z2m3Z3ddl4m5Z5dd
l4m6Z6Gd�d��Z7ej j8rdZ9ndZ9d�:��Z;e<d�e9D����Z=dZ>e<d�e9D����Z?d�@dejA��ZBdZCd�:��ZDd�:��ZEd�:��ZFd�:��ZGd�:��ZHd�ZId�ZJd �ZKd!�ZLd"�ZMd#�ZNd$�ZOd%�ZPGd&�d'ejQ��ZRGd(�d)ejQ��ZSGd*�d+eR��ZTGd,�d-ejQ��ZUGd.�d/ejQ��ZVejWe,pe-d0��Gd1�d2ejQ����ZXGd3�d4eR��ZYGd5�d6ejQ��ZZGd7�d8ejQ��Z[Gd9�d:ejQ��Z\d;�Z]e^d<krej_��dSdS)=�N)�StringIO)�
namedtuple)�urlopen�
urlcleanup)�support)�
import_helper)�	os_helper)�assert_python_ok�assert_python_failure�spawn_python)�threading_helper)�
reap_children�captured_output�captured_stdout�captured_stderr�
is_emscripten�is_wasi�requires_docstrings�MISSING_C_DOCSTRINGS)�TESTFN�rmtree�unlink)�	pydoc_mod)�pydocfodderc��eZdZ	dS)�nonasciiN��__name__�
__module__�__qualname__���A/opt/alt/python311/lib64/python3.11/test/test_pydoc/test_pydoc.pyrr's������ ��Dr"r)�!dictionary for instance variables�%list of weak references to the objectr$r%)�r&r&r&a�
NAME
    test.test_pydoc.pydoc_mod - This is a test module for test_pydoc
%s
CLASSES
    builtins.object
        A
        B
        C
    
    class A(builtins.object)
     |  Hello and goodbye
     |  
     |  Methods defined here:
     |  
     |  __init__()
     |      Wow, I have no function!
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__%s
     |  
     |  __weakref__%s
    
    class B(builtins.object)
     |  Data descriptors defined here:
     |  
     |  __dict__%s
     |  
     |  __weakref__%s
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  NO_MEANING = 'eggs'
     |  
     |  __annotations__ = {'NO_MEANING': <class 'str'>}
    
    class C(builtins.object)
     |  Methods defined here:
     |  
     |  get_answer(self)
     |      Return say_no()
     |  
     |  is_it_true(self)
     |      Return self.get_answer()
     |  
     |  say_no(self)
     |  
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |  
     |  __class_getitem__(item)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables
     |  
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    doc_func()
        This function solves all of the world's problems:
        hunger
        lack of Python
        war
    
    nodoc_func()

DATA
    __xyz__ = 'X, Y and Z'
    c_alias = test.test_pydoc.pydoc_mod.C[int]
    list_alias1 = typing.List[int]
    list_alias2 = list[int]
    type_union1 = typing.Union[int, str]
    type_union2 = int | str

VERSION
    1.2.3.4

AUTHOR
    Benjamin Peterson

CREDITS
    Nobody

FILE
    %s
c#�(K�|]
}|rd|zndV��dS)z
     |      r&Nr!��.0�ss  r#�	<genexpr>r+�sO����&I�&I�*+�?@�&G�&6��&:�&:�R�&I�&I�&I�&I�&I�&Ir"a{
test.test_pydoc.pydoc_mod (version 1.2.3.4)
This is a test module for test_pydoc

Modules
    types
    typing

Classes
    builtins.object
    A
    B
    C

class A(builtins.object)
    Hello and goodbye

    Methods defined here:
        __init__()
            Wow, I have no function!
    ----------------------------------------------------------------------
    Data descriptors defined here:
        __dict__
            dictionary for instance variables
        __weakref__
            list of weak references to the object

class B(builtins.object)
    Data descriptors defined here:
        __dict__
            dictionary for instance variables
        __weakref__
            list of weak references to the object
    ----------------------------------------------------------------------
    Data and other attributes defined here:
        NO_MEANING = 'eggs'
        __annotations__ = {'NO_MEANING': <class 'str'>}


class C(builtins.object)
    Methods defined here:
        get_answer(self)
            Return say_no()
        is_it_true(self)
            Return self.get_answer()
        say_no(self)
    ----------------------------------------------------------------------
    Class methods defined here:
        __class_getitem__(item)
    ----------------------------------------------------------------------
    Data descriptors defined here:
        __dict__
            dictionary for instance variables
        __weakref__
             list of weak references to the object

Functions
    doc_func()
        This function solves all of the world's problems:
        hunger
        lack of Python
        war
    nodoc_func()

Data
    __xyz__ = 'X, Y and Z'
    c_alias = test.test_pydoc.pydoc_mod.C[int]
    list_alias1 = typing.List[int]
    list_alias2 = list[int]
    type_union1 = typing.Union[int, str]
    type_union2 = int | str

Author
    Benjamin Peterson

Credits
    Nobody
c#�BK�|]}|�dd��V��dS)� �&nbsp;N)�replacer(s  r#r+r+�sL����&I�&I�*+�'(�i�i��X�&>�&>�&I�&I�&I�&I�&I�&Ir"z~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.�
z7problem in %s - ModuleNotFoundError: No module named %ra/
Help on class DA in module %s:

class DA(builtins.object)
 |  Data descriptors defined here:
 |  
 |  __dict__%s
 |  
 |  __weakref__%s
 |  
 |  ham
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from Meta:
 |  
 |  ham = 'spam'
z�
Help on class Class in module %s:

class Class(builtins.object)
 |  Data and other attributes inherited from Meta:
 |  
 |  LIFE = 42
z�
Help on class Class1 in module %s:

class Class1(builtins.object)
 |  Data and other attributes inherited from Meta1:
 |  
 |  one = 1
a
Help on class Class2 in module %s:

class Class2(Class1)
 |  Method resolution order:
 |      Class2
 |      Class1
 |      builtins.object
 |  
 |  Data and other attributes inherited from Meta1:
 |  
 |  one = 1
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from Meta3:
 |  
 |  three = 3
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from Meta2:
 |  
 |  two = 2
z�
Help on class C in module %s:

class C(builtins.object)
 |  Data and other attributes defined here:
 |  
 |  here = 'present!'
c�v�	||fz}tdtjg|�Ri|��\}}}|���S�Nz-B)r
�pydoc�__file__�strip��module_name�args�env�rc�out�errs      r#�	run_pydocr=4sJ����;�.� �D�#�D�%�.�G�4�G�G�G�3�G�G�L�B��S��9�9�;�;�r"c�v�	||fz}tdtjg|�Ri|��\}}}|���Sr2)rr3r4r5r6s      r#�run_pydoc_failr?>sJ����;�.� �D�(��u�~�L��L�L�L��L�L�L�B��S��9�9�;�;�r"c���	tj��}|�|��}|�t��pd}|rd|zdz}|���|fS)Nr&z
<br><a href="z">Module Docs</a>)r3�HTMLDoc�	docmodule�	getdoclocrr5)�module�doc�output�locs    r#�get_pydoc_htmlrHFsb��,�
�-�/�/�C�
�]�]�6�
"�
"�F�

�-�-�	�
"�
"�
(�b�C�
�<���$�';�;���<�<�>�>�3��r"c�.�tjdd|��S)Nz.r&)�re�sub)rEs r#�
clean_textrLOs��
�6�%��S�!�!�!r"c	��	tjj}tjj}||||t��������}tj��}|�||���}|S)N)�basedir)�os�path�abspath�dirnamer4r3�TextDocrC)rDrQrRrNrErGs      r#�get_pydoc_linkrTSsi��2��g�o�G��g�o�G��g�g�g�g�g�g�g�h�&7�&7�8�8�9�9�:�:�G�
�-�/�/�C�

�-�-���-�
0�
0�C��Jr"c���	tj��}|�t��pd}|rd|zdz}|�|��}t|��}|���|fS)Nr&z
MODULE DOCS
    r0)r3rSrCrrBrLr5)rDrErGrFs    r#�get_pydoc_textrV\sn��,�
�-�/�/�C�

�-�-�	�
"�
"�
(�b�C�
�1�#�c�)�D�0��
�]�]�6�
"�
"�F�
��
�
�F��<�<�>�>�3��r"c��|�d��\}}}|�d��\}}}|�d��\}}}|S)Nz</head>z<title>z</title>)�	partition)�text�header�_�titles    r#�get_html_titler]gsN���>�>�)�,�,�L�F�A�q��"�"�9�-�-�K�A�q�%��/�/�*�-�-�K�E�1�a��Lr"c	��	|�dd��}|�dd��}tjdd|��}tj|ddd	d
dd��}|S)
Nz<dd>r0z<hr>�F----------------------------------------------------------------------z<.*?>r&r.r-z&gt;�>z&lt;�<)r/rJrKr3)�htmls r#�	html2textrcosb����<�<���%�%�D��<�<���'�'�D�
�6�'�2�t�$�$�D��=��x��f�c�6�3�G�G�D��Kr"c�>�eZdZdd�Zejdd���Zd�ZdS)�
PydocBaseTestNc�h���	|p$tj�t��g�d��fd�	}|S)Nr&c�"���|p�||��S�Nr!)rP�prefix�onerror�default_path�
walk_packagess   ��r#�wrapperz8PydocBaseTest._restricted_walk_packages.<locals>.wrapper�s��� �=��!5��v�w�G�G�Gr")Nr&N)rOrPrRr4)�selfrlrPrmrks `  @r#�_restricted_walk_packagesz'PydocBaseTest._restricted_walk_packages}sU����	��:������ 9� 9�:��	H�	H�	H�	H�	H�	H�	H��r"c#�K�tj}|�||��t_	dV�|t_dS#|t_wxYwrh)�pkgutilrlro)rnrPrls   r#�restrict_walk_packagesz$PydocBaseTest.restrict_walk_packages�s]�����-�
� $� >� >�}�?C�!E�!E���	2��E�E�E�$1�G�!�!�!��M�G�!�1�1�1�1s�A�Ac�|�tj|d��}t|��}|�|||��|S)Nz	text/html)r3�_url_handlerr]�assertEqual)rn�url�expected_titlerY�results     r#�call_url_handlerzPydocBaseTest.call_url_handler�s>���!�#�{�3�3����%�%��������6�6�6��r"rh)rrr ro�
contextlib�contextmanagerrrryr!r"r#rere{s[������������2�2�2���2�����r"rec�X�eZdZdZejeed��oej��d��e	d�����Z
ejeed��oej��d��e	d�����Zd�Zd�Z
d�Zd	�Zd
�Zd�Ze	d���Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zejeed��oej��d��e	d�����Zd�Zd�Zd�Zd�Z d�Z!d�Z"e	d���Z#d�Z$d�Z%d �Z&d!�Z'd"�Z(e	d#���Z)d$�Z*dS)%�PydocDocTestN�gettrace�1trace function introduces __locals__ unexpectedlyc��tt��\}}t|��}d�|���D��}d�|D��}|d=t���}d�|D��}|�||��t
jt��}tj	�
|��}|�||��|�||��|�||��dS)Nc�6�g|]}|�����Sr!�r5�r)�lines  r#�
<listcomp>z.PydocDocTest.test_html_doc.<locals>.<listcomp>�s ��H�H�H�t�d�j�j�l�l�H�H�Hr"c��g|]}|�|��Sr!r!r�s  r#r�z.PydocDocTest.test_html_doc.<locals>.<listcomp>�s��:�:�:�t�T�:�d�:�:�:r"�c�:�g|]}|�|�����Sr!r�r�s  r#r�z.PydocDocTest.test_html_doc.<locals>.<listcomp>�s%��J�J�J�4�T�J�$�*�*�,�,�J�J�Jr")rHrrc�
splitlines�html2text_of_expectedru�inspect�
getabsfile�urllib�parse�quote�assertIn)rnrx�doc_loc�text_result�
text_lines�expected_lines�mod_file�mod_urls        r#�
test_html_doczPydocDocTest.test_html_doc�s���)��3�3������'�'��H�H�{�/E�/E�/G�/G�H�H�H�
�:�:�z�:�:�:�
��q�M�.�9�9�;�;��J�J�>�J�J�J������^�4�4�4��%�i�0�0���,�$�$�X�.�.���
�
�g�v�&�&�&��
�
�h��'�'�'��
�
�g�v�&�&�&�&�&r"c��tt��\}}t|ftzt	jt��fzz}|�||��dSrh)rVr�expected_text_pattern�expected_text_data_docstringsr�r�ru)rnrxr��
expected_texts    r#�
test_text_doczPydocDocTest.test_text_doc�s`��)��3�3����-� �
�5�6� �+�I�6�6�8�9�:�
�	
�����/�/�/�/�/r"c��ddl}Gd�d|j��}tj|��}|�d|��dS)Nrc��eZdZdZdZdS)�IPydocDocTest.test_text_enum_member_with_value_zero.<locals>.BinaryIntegerrr�N)rrr �zero�oner!r"r#�
BinaryIntegerr��s�������D��C�C�Cr"r�zBinaryInteger.zero)�enum�IntEnumr3�
render_docr�)rnr�r�rEs    r#�%test_text_enum_member_with_value_zeroz2PydocDocTest.test_text_enum_member_with_value_zero�sf��	����	�	�	�	�	�D�L�	�	�	���}�-�-���
�
�*�C�0�0�0�0�0r"c�n�ttjj��}|�d|��dS)Nzxml.etree.elementtree)rT�xml�etree�ElementTreer�)rn�doc_links  r#�,test_mixed_case_module_names_are_lower_casedz9PydocDocTest.test_mixed_case_module_names_are_lower_cased�s/��!�#�)�"7�8�8���
�
�-�x�8�8�8�8�8r"c�l�ttj��\}}|�|dd��dS)Nr&z'MODULE DOCS incorrectly includes a link)rVr�r�ru)rnrxr�s   r#�test_issue8225zPydocDocTest.test_issue8225�s4��(���3�3��������"�&O�P�P�P�P�Pr"c��tj}	dt_tj��|t_dS#|t_wxYwrh)�sys�stdinr3�getpager)rn�previous_stdins  r#�test_getpager_with_stdin_nonez*PydocDocTest.test_getpager_with_stdin_none�sA�����	'��C�I��N����&�C�I�I�I���C�I�&�&�&�&s	�;�A	c��Gd�d��}Gd�d��}tj|����}tj|����}|�|�dd��|��dS)Nc��eZdZdZdS)�)PydocDocTest.test_non_str_name.<locals>.A�*Nrr!r"r#�Ar��s�������H�H�Hr"r�c��eZdZdS)�)PydocDocTest.test_non_str_name.<locals>.BNrr!r"r#�Br����������Dr"r�)r3r�rur/)rnr�r��adoc�bdocs     r#�test_non_str_namezPydocDocTest.test_non_str_name�s���	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�������$�$��������$�$��������c�3�/�/��6�6�6�6�6r"c��d}tt|��d��}t|z}|�||d��dS)N�test.i_am_not_here�asciiz&documentation for missing module found)�strr?�missing_patternru�rn�missing_modulerx�expecteds    r#�
test_not_herezPydocDocTest.test_not_here�sQ��-���^�N�3�3�W�=�=��"�^�3������6�4�	6�	6�	6�	6�	6r"c��tdd���}tj�dd��}|�||��dS)Nz#test.test_pydoc.test_pydoc.nonasciir�)�PYTHONIOENCODING�backslashreplace)r=r�__doc__�encoder�)rnrx�encodeds   r#�test_not_asciizPydocDocTest.test_not_ascii�sI���@�SZ�[�[�[���"�)�)�'�3E�F�F���
�
�g�v�&�&�&�&�&r"c��d}tt|��d��}t|���z}|�||��dS)Nz test.i_am_not_here r�)r�r?r�r5rur�s    r#�test_input_stripzPydocDocTest.test_input_strip�sP��/���^�N�3�3�W�=�=��"�^�%9�%9�%;�%;�;������6�*�*�*�*�*r"c��tj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��dS)Nz<function stripid at 0x88dcee4>z<function stripid>z <function stripid at 0x01F65390>�42z<type 'exceptions.Exception'>)r3�stripidru)rnr�s  r#�test_stripidzPydocDocTest.test_stripid�s����-�������!B�C�C�-�	/�	/�	/������!C�D�D�-�	/�	/�	/�	
���������-�-�-������!@�A�A�8�	:�	:�	:�	:�	:r"c��	tj��}|�t��}d}|�||��dS)Nz� |  Built-in subclasses:
 |      async_generator
 |      BaseException
 |      builtin_function_or_method
 |      bytearray
 |      ... and \d+ other subclasses)r3rS�docclass�object�assertRegex�rnrErY�snips    r#�)test_builtin_with_more_than_four_childrenz6PydocDocTest.test_builtin_with_more_than_four_childrensJ��	�(�m�o�o���|�|�F�#�#��8��	
����t�$�$�$�$�$r"c��	tj��}|�t��}d}|�||��dS)Nzc |  Built-in subclasses:
 |      FloatingPointError
 |      OverflowError
 |      ZeroDivisionError)r3rSr��ArithmeticErrorr�r�s    r#�test_builtin_with_childz$PydocDocTest.test_builtin_with_child sH��	�$�m�o�o���|�|�O�,�,��,��	
�
�
�d�D�!�!�!�!�!r"c��	tj��}|�t��}d}|�||��|�d|��dS)Nz^ |  Built-in subclasses:
 |      ArithmeticError
 |      AssertionError
 |      AttributeError�ZeroDivisionError)r3rSr��	Exceptionr��assertNotInr�s    r#�test_builtin_with_grandchildz)PydocDocTest.test_builtin_with_grandchild;s_��	�*�m�o�o���|�|�I�&�&��)��	
�
�
�d�D�!�!�!����,�d�3�3�3�3�3r"c��	tj��}|�t��}|�d|��dS�NzBuilt-in subclasses)r3rSr�r�r��rnrErYs   r#�test_builtin_no_childz"PydocDocTest.test_builtin_no_child[sC��	�,�m�o�o���|�|�-�.�.�����.��5�5�5�5�5r"c��	tj��}|�t��}|�d|��dSr�)r3rSr��typer�r�s   r#�test_builtin_on_metaclassesz(PydocDocTest.test_builtin_on_metaclasseswsB��	�
�m�o�o���|�|�D�!�!�����.��5�5�5�5�5r"c��tdz���}td��5}|�d��\}}|������dd�}|d�d��|d<|�||��ddd��dS#1swxYwYdS)N�abdz-chelp()sabdi����i����rzhelp> )r�r�r�communicate�decode�removeprefixru)rn�elines�procr;r[�oliness      r#�test_fail_help_clizPydocDocTest.test_fail_help_cli�s���!�E�)�5�5�7�7��
�-�
(�
(�	-�D��%�%�f�-�-�F�C���Z�Z�\�\�,�,�.�.�r�"�u�5�F��q�	�.�.�x�8�8�F�1�I����V�V�,�,�,�		-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�	-�	-s�A;B4�4B8�;B8c�l�t��5}tj|���}|�d��tdz}|�||�������dtj
����ddd��dS#1swxYwYdS)N�rFr�r0)rr3�Helper�helpr�ru�getvaluer5r/rO�linesep)rn�buf�helperr�s    r#�test_fail_help_output_redirectz+PydocDocTest.test_fail_help_output_redirect�s���
�Z�Z�	Y�3��\��-�-�-�F��K�K�����&��.�H����X�s�|�|�~�~�';�';�'=�'=�'E�'E�d�B�J�'W�'W�X�X�X�		Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y����	Y�	Y�	Y�	Y�	Y�	Ys�B
B)�)B-�0B-c��tj}d�}d|_t��}tj|���}tt��\}}d}d���}tj	|��}|tz}	|t_	td��5}
td��5}|�|��|�
�����}|	|ftzt!jt��fzz}
|�d|
�
����|�d|�
����|�|
|��ddd��n#1swxYwYddd��n#1swxYwY|t_dS#|t_wxYw)Nc��d�S)Nc��|Srhr!)�xs r#�<lambda>zJPydocDocTest.test_help_output_redirect.<locals>.<lambda>.<locals>.<lambda>�s��!�r"r!r!r"r#rz8PydocDocTest.test_help_output_redirect.<locals>.<lambda>�s����r"r�ztest.test_pydoc.pydoc_modzO
        Help on module test.test_pydoc.pydoc_mod in test.test_pydoc:

        �stdout�stderrr&)r3r��maxDiffrr�rVr�lstrip�textwrap�dedentr�rr�r�r5r�r�r�ru)rn�getpager_old�getpager_newr�r��unusedr�rD�help_header�expected_help_patternrFr<rxr�s              r#�test_help_output_redirectz&PydocDocTest.test_help_output_redirect�s���~��,�,������j�j����S�)�)�)��(��3�3����,���
�F�H�H�	��o�k�2�2�� +�.C� C��%���
	*� ��*�*�

8�f� ��*�*�

8�.1����F�#�#�#������-�-�/�/�� 5�!(�
� =�!>�!(�!3�I�!>�!>� @�!A�!B�
�� � ��V�_�_�%6�%6�7�7�7�� � ��S�\�\�^�^�4�4�4�� � ���7�7�7�

8�

8�

8�

8�

8�

8�

8�

8�

8�

8�

8����

8�

8�

8�

8�

8�

8�

8�

8�

8�

8�

8�

8�

8�

8�

8����

8�

8�

8�

8�*�E�N�N�N��\�E�N�)�)�)�)sU�F8�!F�1CF�<F�F	�F�F	�F�F8�F#�#F8�&F#�'F8�8Gc���d�}dti|_td��5}tj|��ddd��n#1swxYwY|���}|�d|��dS)Nc��dS�Nr�r!��a�b�cs   r#rzAPydocDocTest.test_lambda_with_return_annotation.<locals>.<lambda>����q�r"�returnrzlambda (a, b, c) -> int��int�__annotations__rr3r�r�r��rn�func�help_io�helptexts    r#�"test_lambda_with_return_annotationz/PydocDocTest.test_lambda_with_return_annotation�s��� � �� (�#����
�X�
&�
&�	�'��J�t����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��#�#�%�%���
�
�/��:�:�:�:�:��A�A�	Ac�
�d�}tttd�|_td��5}tj|��ddd��n#1swxYwY|���}|�d|��dS)Nc��dSrr!rs   r#rzDPydocDocTest.test_lambda_without_return_annotation.<locals>.<lambda>�rr"rrzlambda (a: int, b: int, c: int)rrs    r#�%test_lambda_without_return_annotationz2PydocDocTest.test_lambda_without_return_annotation�s��� � ��%(�s��=�=���
�X�
&�
&�	�'��J�t����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��#�#�%�%���
�
�7��B�B�B�B�Bs�A�A�Ac��d�}ttttd�|_td��5}tj|��ddd��n#1swxYwY|���}|�d|��dS)Nc��dSrr!rs   r#rzLPydocDocTest.test_lambda_with_return_and_params_annotation.<locals>.<lambda>�rr")rrrrrz&lambda (a: int, b: int, c: int) -> intrrs    r#�-test_lambda_with_return_and_params_annotationz:PydocDocTest.test_lambda_with_return_and_params_annotation�s��� � ��%(�s���L�L���
�X�
&�
&�	�'��J�t����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��#�#�%�%���
�
�>��I�I�I�I�Is�A�A�Ac�v�tdddg��}t��5}tj|��ddd��n#1swxYwY|���}|�d|��|�d|��|�d|��|�d|��dS)N�Person�nickname�	firstnamezAlias for field number 0zAlias for field number 1�rrr3r�r�r�)rnr)rrs    r#�test_namedtuple_fieldsz#PydocDocTest.test_namedtuple_fields�s����H�z�;�&?�@�@��
�
�
�	�'��J�v����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��#�#�%�%���
�
�j�(�+�+�+��
�
�k�8�,�,�,��
�
�0�(�;�;�;��
�
�0�(�;�;�;�;�;r!c�N�tdddgd���}t��5}tj|��ddd��n#1swxYwY|���}|�d|��|�d|��|�d|��dS)	N�NT�abc�defT)�rename�_1�_replace�_asdictr,)rnr/rrs    r#�!test_namedtuple_public_underscorez.PydocDocTest.test_namedtuple_public_underscore�s���
��u�e�n�T�
:�
:�
:��
�
�
�	�'��J�r�N�N�N�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��#�#�%�%���
�
�d�H�%�%�%��
�
�j�(�+�+�+��
�
�i��*�*�*�*�*s�A�A�Ac��|�tt��dD]�}ttd|���5}|dkr$t	d�|��|���t	d|���t	d|���ddd��n#1swxYwYt
jti��}|�|d	����dS)
N)z
ISO-8859-1�UTF-8�w��encodingr8z#coding: {})�fileu"""line 1: héz
line 2: hi"""uline 1: hé)	�
addCleanuprr�open�print�formatr3�synopsisru)rnr;�scriptrAs    r#�
test_synopsiszPydocDocTest.test_synopsis�s�������'�'�'�/�	8�	8�H��f�c�H�5�5�5�
4���w�&�&��-�.�.�x�8�8�v�F�F�F�F��(�v�6�6�6�6��o�F�3�3�3�3�	
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4�
�~�f�b�1�1�H����X��7�7�7�7�	8�	8s�A
B�B	�B	c���tjd��}|j���d}|j}tj|��}|�||��dS)NrOr)r�import_fresh_moduler�r��
__cached__r3rAru)rnrOr��filenamerAs     r#�test_synopsis_sourcelessz%PydocDocTest.test_synopsis_sourceless�s\��
�
.�t�
4�
4���:�(�(�*�*�1�-���=���>�(�+�+������8�,�,�,�,�,r"c�&�tj��5}tj�|d��}t
j�|��}t|d��5}|�	d��ddd��n#1swxYwYtj|��tj
|i��}|�|��tj
|i��}|�|��ddd��dS#1swxYwYdS)Nzfoomod42.pyr9�foo = 1)r	�temp_cwdrOrP�join�	importlib�util�cache_from_sourcer>�write�
py_compile�compiler3rA�assertIsNone)rn�test_dir�	init_path�cached_path�fobjrA�synopsis_cacheds       r#�"test_synopsis_sourceless_empty_docz/PydocDocTest.test_synopsis_sourceless_empty_doc�sk��
�
�
!�
!�		/�X�����X�}�=�=�I�#�.�:�:�9�E�E�K��i��%�%�
&���
�
�9�%�%�%�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&���y�)�)�)��~�i��4�4�H����h�'�'�'�#�n�[�"�=�=�O����o�.�.�.�		/�		/�		/�		/�		/�		/�		/�		/�		/�		/�		/�		/����		/�		/�		/�		/�		/�		/s7�AD�$B�:D�B
	�
D�
B
	�A+D�D
�
D
c�Z�d}|�tj|��d��dS)Nz#I Am A Doc


Here is my description)z
I Am A Docz
Here is my description)rur3�splitdoc)rn�example_strings  r#�test_splitdoc_with_descriptionz+PydocDocTest.test_splitdoc_with_descriptions=��A��������7�7�C�	E�	E�	E�	E�	Er"c��tj��5}|�tj|����ddd��dS#1swxYwYdSrh)r	rK�assertFalser3�	ispackage)rnrTs  r#� test_is_package_when_not_packagez-PydocDocTest.test_is_package_when_not_packages���
�
�
!�
!�	8�X����U�_�X�6�6�7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8�	8�	8s�(A	�	A
�A
c�X�tj��5}tj�|d��}t|d�����|�tj	|����tj
|��ddd��dS#1swxYwYdS)N�__init__.pyr9)r	rKrOrPrLr>�close�
assertTruer3r`�remove)rnrTrUs   r#�test_is_package_when_is_packagez,PydocDocTest.test_is_package_when_is_package
s���
�
�
!�
!�	!�X�����X�}�=�=�I���C� � �&�&�(�(�(��O�O�E�O�H�5�5�6�6�6��I�i� � � �		!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	!�	!s�A>B�B#�&B#c�
�Gd�dt��}ttt����}|j|d<|d=|d=|j|d<|j|d<t
j|��}|�||��dS)Nc��eZdZd�ZdS)�/PydocDocTest.test_allmethods.<locals>.TestClassc��dS)NTr!�rns r#�method_returning_truezEPydocDocTest.test_allmethods.<locals>.TestClass.method_returning_trues���tr"N)rrr rmr!r"r#�	TestClassrjs#������
�
�
�
�
r"rnrmr��	__class__�__subclasshook__�__init_subclass__)	r��dict�varsrmrprqr3�
allmethods�assertDictEqual)rnrnr��methodss    r#�test_allmethodszPydocDocTest.test_allmethodss���	�	�	�	�	��	�	�	�
��V���%�%��,5�,K��(�)��Y���[�!�(1�'A��#�$�(1�(C��$�%��"�9�-�-�����W�h�/�/�/�/�/r"c���Gd�d���G�fd�d���}tj|��}t|��}|�|dtz��tj|tj�����}dt�d�}t
|��}d	�|�d
��D��}|D]}|�||���dS)Nc� �eZdZdd�ZeZd�ZdS)�+PydocDocTest.test_method_aliases.<locals>.ANc��dSrhr!)rn�	aboveThiss  r#�tkraisez3PydocDocTest.test_method_aliases.<locals>.A.tkraise-s��>�>r"c��dSrhr!rls r#�a_sizez2PydocDocTest.test_method_aliases.<locals>.A.a_size0s��!�!r"rh)rrr r}�liftrr!r"r#r�rz,s<������
?�
?�
?�
?��D�
"�
"�
"�
"�
"r"r�c�*��eZdZdd�ZeZ�jZdS)�+PydocDocTest.test_method_aliases.<locals>.BNc��dSrhr!)rn�tagOrId�cnf�kws    r#�
itemconfigurez9PydocDocTest.test_method_aliases.<locals>.B.itemconfigure3s��=�=r"rh)rrr r��
itemconfigr�b_size)r�s�r#r�r�2s/�������
>�
>�
>�
>�&�J��X�F�F�Fr"r�a�Python Library Documentation: class B in module %s

class B(A)
 |  Method resolution order:
 |      B
 |      A
 |      builtins.object
 |  
 |  Methods defined here:
 |  
 |  b_size = a_size(self)
 |  
 |  itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw)
 |  
 |  itemconfigure(self, tagOrId, cnf=None, **kw)
 |      Configure resources of an item TAGORID.
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from A:
 |  
 |  a_size(self)
 |      Return size
 |  
 |  lift = tkraise(self, aboveThis=None)
 |  
 |  tkraise(self, aboveThis=None)
 |      Raise this widget in the stacking order.
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from A:
 |  
 |  __dict__
 |      dictionary for instance variables
 |  
 |  __weakref__
 |      list of weak references to the object
��rendererz1
Python Library Documentation

class B in module a�
class B(A)
    Method resolution order:
        B
        A
        builtins.object

    Methods defined here:
        b_size = a_size(self)
        itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw)
        itemconfigure(self, tagOrId, cnf=None, **kw)
            Configure resources of an item TAGORID.

    Methods inherited from A:
        a_size(self)
            Return size
        lift = tkraise(self, aboveThis=None)
        tkraise(self, aboveThis=None)
            Raise this widget in the stacking order.

    Data descriptors inherited from A:
        __dict__
            dictionary for instance variables
        __weakref__
            list of weak references to the object
c�:�g|]}|�|�����Sr!r�r�s  r#r�z4PydocDocTest.test_method_aliases.<locals>.<listcomp>�s&��U�U�U�4�PT�U�$�*�*�,�,�U�U�Ur"r0)	r3r�rLrurrArc�splitr�)rnr�rEr��as_textr��
expected_liner�s       @r#�test_method_aliasesz PydocDocTest.test_method_aliases*s>���	"�	"�	"�	"�	"�	"�	"�	"�	�	�	�	�	�	�	��	�	�	���q�!�!����o�o������%�J�K%�%	�%	�%	�N��q�5�=�?�?�;�;�;�������
�:�C�.�.��U�U�=�3F�3F�t�3L�3L�U�U�U��+�	2�	2�M��M�M�-��1�1�1�1�	2�	2r"c��ddl}t|��\}}t|��\}}tt��\}}tt��\}}|jD]e}|�d�}d|�d�}	|�||��|�|	|��|�||��|�|	|���fdS)Nrz = _Featurez<strong>z</strong> = _Feature)�
__future__rVrHr�all_feature_namesr�r�)
rnr��future_textr[�future_html�pydoc_mod_text�pydoc_mod_html�feature�txtrbs
          r#�test__future__importsz"PydocDocTest.test__future__imports�s���	����'�
�3�3���Q�'�
�3�3���Q�*�9�5�5����*�9�5�5����!�3�	3�	3�G��)�)�)�C�;�g�;�;�;�D��M�M�#�{�+�+�+��M�M�$��,�,�,����S�.�1�1�1����T�>�2�2�2�2�
	3�	3r")+rrr r�unittest�skipIf�hasattrr�r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr r$r'r-r6rCrHrYr]rargrwr�r�r!r"r#r}r}�s �������G��X�_�W�W�S�*�-�-�@�,�#�,�.�.�H�J�J��
'�
'���J�J�
'��X�_�W�W�S�*�-�-�@�,�#�,�.�.�H�J�J��0�0���J�J�0�1�1�1�9�9�9�
Q�Q�Q�
'�'�'�
7�
7�
7�6�6�6��'�'���'�
+�+�+�:�:�:�%�%�%�>"�"�"�64�4�4�@6�6�6�8	6�	6�	6�-�-�-�Y�Y�Y��X�_�W�W�S�*�-�-�@�,�#�,�.�.�H�J�J�� *� *���J�J� *�D;�;�;�C�C�C�J�J�J�<�<�<�+�+�+�	8�	8�	8��-�-���-�
/�
/�
/�E�E�E�
8�8�8�!�!�!�0�0�0�2�W2�W2���W2�r3�3�3�3�3r"r}c��eZdZd�Zd�Zd�Zd�Zeje	j
ed��d�����Zd�Z
e	jd��d	���Ze	jd��d
���Ze	jd��d���Zd
�ZdS)�PydocImportTestc��tjt��|_|�t
t��t
j��dSrh)rO�mkdirrrTr=rrM�invalidate_cachesrls r#�setUpzPydocImportTest.setUp�s<�����(�(��
������'�'�'��#�%�%�%�%�%r"c�B�d}dddd�|��dfd�|��d�|��ff}tj�t|��tjzdz}|D]�\}}t
|d	��5}|�d
�|����ddd��n#1swxYwYt|t����	d��}t||fz}|�||����dS)
N�
testmod_xyzzy)�
i_am_not_herer�)�test.i_am_not_here_eitherr�)ztest.i_am_not_here.neither_am_ir�zi_am_not_here.{}r�ztest.{}�pyr9z
import {}
)�
PYTHONPATHr�)r@rOrPrLr�extsepr>rPr?r��badimport_patternru)	rn�modname�	testpairs�sourcefn�importstring�
expectedinmsg�frxr�s	         r#�test_badimportzPydocImportTest.test_badimport�s^��"��.�F�E�
�
&�
&�w�
/�
/��A�
�
�
�g�
&�
&�	�(8�(8��(A�(A�B��	��7�<�<���0�0�2�9�<�t�C��+4�	/�	/�'�L�-��h��$�$�
<�����
�,�,�\�:�:�;�;�;�
<�
<�
<�
<�
<�
<�
<�
<�
<�
<�
<����
<�
<�
<�
<�#�G��?�?�?�F�F�w�O�O�F�(�G�]�+C�C�H����X�v�.�.�.�.�	/�	/s�)C�C	�C	c��tj�td��}tj|��tj�|d��tjzdz}t
|d��5}|�d��ddd��n#1swxYwY|�tg���5t��5}t��5}tjd��ddd��n#1swxYwYddd��n#1swxYwY|�
|���d��|�
|���d��t��5}t��5}tjd��ddd��n#1swxYwYddd��n#1swxYwY|�
|������d��|�
|���d��ddd��dS#1swxYwYdS)	N�	syntaxerr�__init__r�r9zinvalid python syntax = $1
�rP�xyzzyr&)rOrPrLrr�r�r>rPrrrrr3�aproposrur�r5)rn�pkgdir�	badsyntaxr�r;r<s      r#�test_apropos_with_bad_packagez-PydocImportTest.test_apropos_with_bad_package�sZ������f�k�2�2��
�������G�L�L���4�4�r�y�@�4�G�	�
�)�S�
!�
!�	4�Q�
�G�G�2�3�3�3�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4����	4�	4�	4�	4�
�
(�
(�v�h�
(�
7�
7�	1�	1� �"�"�
+�c�$�&�&�+�#��M�'�*�*�*�+�+�+�+�+�+�+�+�+�+�+����+�+�+�+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+����
+�
+�
+�
+�
���S�\�\�^�^�R�0�0�0����S�\�\�^�^�R�0�0�0� �"�"�
/�c�$�&�&�/�#��M�+�.�.�.�/�/�/�/�/�/�/�/�/�/�/����/�/�/�/�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/����
/�
/�
/�
/�
���S�\�\�^�^�1�1�3�3�[�A�A�A����S�\�\�^�^�R�0�0�0�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1����	1�	1�	1�	1�	1�	1s��:B�B �#B �I�D�!D�6D�D�D�	D�
D�
I�D	�I� D	�!A!I�G	�F2�&G	�2F6�6G	�9F6�:G	�=I�	G
	�
I�G
	�A%I�I�
Ic��tj�td��|_tj|jd��|�tj|j��|�tg���5t��5}t��5}tjd��ddd��n#1swxYwYddd��n#1swxYwYddd��n#1swxYwY|�
|���d��|�
|���d��dS)N�
unreadablerr��SOMEKEYr&)rOrPrLr�unreadable_dirr�r=�rmdirrrrrr3r�rur�)rnr;r<s   r#� test_apropos_with_unreadable_dirz0PydocImportTest.test_apropos_with_unreadable_dir�s��� �g�l�l�6�<�@�@���
���$�a�(�(�(������$�"5�6�6�6��
(�
(�v�h�
(�
7�
7�	-�	-� �"�"�
-�c�$�&�&�-�#��M�)�,�,�,�-�-�-�-�-�-�-�-�-�-�-����-�-�-�-�
-�
-�
-�
-�
-�
-�
-�
-�
-�
-�
-����
-�
-�
-�
-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�
	
���������,�,�,����������,�,�,�,�,sZ�C3�C�$C�9C�C	�	C�C	�
C�C3�C 	� C3�#C 	�$C3�3C7�:C7zcannot remove x bitc��tj�td��}tj|��|�t|��tj�|d��}t|d��5}|�d��ddd��n#1swxYwYtj
tj	|��j��}	tj||tj
z��|�tg���5t��5}t!jd��ddd��n#1swxYwYddd��n#1swxYwY|�d|�����tj||��dS#tj||��wxYw)N�walkpkgrcr9rJr�r&)rOrPrLrr�r=rr>rP�stat�S_IMODE�st_mode�chmod�S_IEXECrrrr3r�r�r�)rnr�rUrW�current_moders      r#�test_apropos_empty_docz&PydocImportTest.test_apropos_empty_doc�s*������f�i�0�0��
�����������'�'�'��G�L�L���7�7�	�
�)�S�
!�
!�	"�T��J�J�y�!�!�!�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"��|�B�G�F�O�O�$;�<�<��	+��H�V�\�T�\�M�9�:�:�:��,�,�6�(�,�;�;�
"�
"�_�=N�=N�
"�RX��
�b�!�!�!�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"����
"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"����
"�
"�
"�
"��M�M�)�V�_�_�%6�%6�7�7�7��H�V�\�*�*�*�*�*��B�H�V�\�*�*�*�*���sf�B'�'B+�.B+�?F.�E$�,E
�E$�
E	�E$�E	�E$�F.�$E(�(F.�+E(�,+F.�.Gc�:�tj�td��}tj|��tj�|d��}t|dd���5}|�d��ddd��n#1swxYwY|�tg���5ttj��}tj�
dt��	|�td	��5ddl
}ddd��n#1swxYwY|�d
d��}d}|�||��|tjdd�<n#|tjdd�<wxYw	ddd��dS#1swxYwYdS)
N�test_error_packagerc�wtr�r:zraise ValueError("ouch")
r�r�ouchzsearch?key=test_error_package�Pydoc: Search Resultsz8<a href="test_error_package.html">test_error_package</a>)rOrPrLrr�r>rPrr�tupler��insert�assertRaisesRegex�
ValueErrorr�ryr�)rnr��initr��saved_pathsr�rY�founds        r#�test_url_search_package_errorz-PydocImportTest.test_url_search_package_error�s9������f�&:�;�;��
�������w�|�|�F�M�2�2��
�$��w�
/�
/�
/�	6�1�
�G�G�4�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�
�
(�
(�v�h�
(�
7�
7�	*�	*����/�/�K��H�O�O�A�v�&�&�&�

*��+�+�J��?�?�.�.�-�-�-�-�.�.�.�.�.�.�.�.�.�.�.����.�.�.�.��,�,�-L�+�-�-��-���
�
�e�T�*�*�*�)���������k�������)�)�)�)��	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*s`�,B�B�B�5?F�5E,�D!�E,�!D%	�%E,�(D%	�)1E,�F�,E?�?F�F�Fz(causes undesirable side-effects (#20128)c�8�d}d}d}||z|z}t��}tj|���}|d��|������}t|�����}|�||��dS)N���r��modules)rr3r�r�r5�lenr��assertGreaterEqual)	rn�num_header_lines�num_module_lines_min�num_footer_linesr�rFr�rx�	num_liness	         r#�test_moduleszPydocImportTest.test_modules�s����� ����#�&:�:�=M�M��������V�,�,�,����y�������"�"�(�(�*�*����)�)�+�+�,�,�	����	�8�4�4�4�4�4r"c��d}t��}tj|���}t��5}|d��ddd��n#1swxYwY|���}|�||��dS)Nzpydoc - r�z
modules pydoc)rr3r�rr�r��rnr�rFr�rrxs      r#�test_modules_searchz#PydocImportTest.test_modules_searchs�����������V�,�,�,��
�
�
�	$�'��F�?�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$��!�!�#�#���
�
�h��'�'�'�'�'��A�A�Az+some buildbots are not cooperating (#20128)c�*�d}t��}tj|���}t��5}|d��ddd��n#1swxYwY|���}|�|�|����dS)Nzgc - r�zmodules garbage)rr3r�rr�re�
startswithr�s      r#�test_modules_search_builtinz+PydocImportTest.test_modules_search_builtins�����������V�,�,�,��
�
�
�	&�'��F�$�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&��!�!�#�#������)�)�(�3�3�4�4�4�4�4r�c�B�tjtj��}|�|t��|�|jd��|�|jtj��|�|jtj��dS)Nr3)r3�
importfiler4�assertIsNotrur�__spec__)rn�loaded_pydocs  r#�test_importfilezPydocImportTest.test_importfile(s���'���7�7������u�-�-�-�����.��8�8�8�����.���?�?�?�����.���?�?�?�?�?r"N)rrr r�r�r�r�r	�skip_unless_working_chmodr�r�rr�r��skipr�r�r�r�r!r"r#r�r��s(������&�&�&�
/�/�/�*1�1�1�*
-�
-�
-��(��X�_�]�$9�:�:�+�+�;�:�)�(�+� *�*�*�.�X�]�=�>�>�
5�
5�?�>�
5��X�]�=�>�>�
(�
(�?�>�
(��X�]�@�A�A�	5�	5�B�A�	5�@�@�@�@�@r"r�c���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
d���Ze
d	���Zd
�Z
ed���Zd�Zd
�Zed���Zed���Zd�Zd�Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Z d�Z!d�Z"ed���Z#d S)!�TestDescriptionsc�d�tjt��}|�d|��dS)Nr)r3r�rr��rnrEs  r#�test_modulezTestDescriptions.test_module3s,����{�+�+���
�
�m�S�)�)�)�)�)r"c�8�Gd�d��}|��}|�tj|��d��|�tj|��d��dtz}|�|tj|����dS)Nc��eZdZdS)�&TestDescriptions.test_class.<locals>.CNrr!r"r#�Cr�9��������r"r�zclass CzC in module %s object)rur3�describerr�r�)rnr�rr�s    r#�
test_classzTestDescriptions.test_class8s���"�"�"�"�"�"�"�"�
�A�C�C��������*�*�I�6�6�6�������*�*�C�0�0�0�*�X�5���
�
�h�� 0�� 3� 3�4�4�4�4�4r"c��|�tjtjt
��d��tjtjt
tj���}|�d|��|�d|��tsJ|�tj����
��d|��|�tjtt
��d��tjtt
tj���}|�d|��|�d|��tsL|�tj����
��d|��dSdS)	N�
_GenericAliasr�z_GenericAlias in module typingzList = class list(object)r�GenericAliaszGenericAlias in module builtinsz
class list(object))rur3r��typing�Listrr��	plaintextr�r�listr�r5r�r�s  r#�test_generic_aliasz#TestDescriptions.test_generic_aliasAsd���������C�(8�9�9�?�K�K�K���v�{�3�/�%�/�J�J�J���
�
�6��<�<�<��
�
�1�3�7�7�7�#�	E��M�M�$�,�,�,�.�.�9�9�;�;�A�>��D�D�D�������S�	�2�2�N�C�C�C���t�C�y�5�?�C�C�C���
�
�7��=�=�=��
�
�,�c�2�2�2�#�	E��M�M�$�,�,�,�.�.�9�9�;�;�A�>��D�D�D�D�D�	E�	Er"c���|�tjtjt
tf��d��tjtjt
tftj���}|�	d|��|�	d|��tjj
rO|�	tjj
������d|��|�tjt
tz��d��tjt
tztj���}|�	d|��|�	d|��tsQ|�	tjj
������d|��dSdS)	N�_UnionGenericAliasr�z#_UnionGenericAlias in module typingzUnion = typing.Unionr�	UnionTypez UnionType in module types objectz!
class UnionType(builtins.object))rur3r�r�Unionrr�r�rr�r�r5r�r�typesr	r�s  r#�test_union_typez TestDescriptions.test_union_typePsx���������S�#�X�(>�?�?�AU�V�V�V���v�|�C��H�5���P�P�P���
�
�;�S�A�A�A��
�
�,�c�2�2�2��<��	M��M�M�&�,�.�4�4�6�6�A�A�C�C�A�F��L�L�L�������c�	�2�2�K�@�@�@���s�S�y�5�?�C�C�C���
�
�8�#�>�>�>��
�
�:�C�@�@�@�#�	P��M�M�%�/�1�7�7�9�9�D�D�F�F�q�I�3�O�O�O�O�O�	P�	Pr"c��|�tjtj��d��tjtjtj���}|�d|��tjjrg|�d|��|�tjj�	���
��d|��dS|�d|��dS)N�_SpecialFormr�z_SpecialForm in module typingzNoReturn = typing.NoReturnrz%NoReturn = class _SpecialForm(_Final))rur3r�r�NoReturnr�rr�r�r5r�r�s  r#�test_special_formz"TestDescriptions.test_special_form_s����������8�8�.�I�I�I���v����I�I�I���
�
�5�s�;�;�;��?�"�	H��M�M�6��<�<�<��M�M�&�/�1�7�7�9�9�D�D�F�F�q�I�3�O�O�O�O�O��M�M�A�3�G�G�G�G�Gr"c	�X�dtjtjdtdtjtjttjffd�}tjd��}Gd�dtj|tjttf��}|�
tj|���
��dd	��|�
tj|���
��d
d��dS)N�datarrc��dSrhr!)rrs  r#�fooz/TestDescriptions.test_typing_pydoc.<locals>.foojs���Cr"�Tc��eZdZdS)�-TestDescriptions.test_typing_pydoc.<locals>.CNrr!r"r#r�rnr�r"r����z?ffoooo(data: List[Any], x: int) -> Iterator[Tuple[int, Any]]r�z2class CC(collections.abc.Mapping, typing.Generic))rr�Anyr�Iterator�Tuple�TypeVar�Generic�Mappingr�rur3r�r�)rnrrr�s    r#�test_typing_pydocz"TestDescriptions.test_typing_pydocis��	�f�k�&�*�-�	��	�!�?�6�<��V�Z��+H�I�	�	�	�	�
�N�3����A�A�A�A�A���q�!�6�>�#�s�(�#;�A�A�A�����)�#�.�.�9�9�;�;�B�?�9�	:�	:�	:�	
����)�!�,�,�7�7�9�9�!�<�P�	R�	R�	R�	R�	Rr"c��dD]v}|�tj|����	tj|���?#t$r+|�d�|����Y�swxYwdD]O}|�tj|����|�ttj|���PdS)N)r�z
str.translatezbuiltins.strzbuiltins.str.translatezfinding the doc of {!r} failed)�notbuiltins�strrrzstrr.translatezstr.trrrranslatezbuiltins.strrrzbuiltins.str.trrranslate)	�assertIsNotNoner3�locater��ImportError�failr@rS�assertRaises)rn�names  r#�test_builtinzTestDescriptions.test_builtinus���/�	I�	I�D�
� � ���d�!3�!3�4�4�4�
I�� ��&�&�&�&���
I�
I�
I��	�	�:�A�A�$�G�G�H�H�H�H�H�
I����1�	C�	C�D�
���e�l�4�0�0�1�1�1����k�5�+;�T�B�B�B�B�		C�	Cs�A�2A7�6A7c��tjtj|����}|�d��}|dS�Nr0r�)r3�plainr�r���orY�liness   r#�_get_summary_linez"TestDescriptions._get_summary_line�s6���{�5�+�A�.�.�/�/���
�
�4� � ���Q�x�r"c��tjtj|����}|�d��}d�|dd���Sr+)r3r,r�r�rLr-s   r#�_get_summary_linesz#TestDescriptions._get_summary_lines�sG���{�5�+�A�.�.�/�/���
�
�4� � ���y�y��q�r�r��#�#�#r"c�v�|�|�tjj��d��dS)Nzwrap(self, text))rur0r�TextWrapper�wraprls r#�test_unbound_python_methodz+TestDescriptions.test_unbound_python_method�s=������/�/��0D�0I�J�J��	 �	 �	 �	 �	 r"c�v�|�|�tjj��d��dS)Nz1dump(self, obj, /) unbound _pickle.Pickler method)rur0�_pickle�Pickler�dumprls r#�test_unbound_builtin_methodz,TestDescriptions.test_unbound_builtin_method�sA������/�/���0D�E�E�?�	A�	A�	A�	A�	Ar"c��tj��}|�|�|j��d��dS)Nz2wrap(text) method of textwrap.TextWrapper instance)rr4rur0r5)rn�ts  r#�test_bound_python_methodz)TestDescriptions.test_bound_python_method�sL��� �"�"������/�/���7�7�@�	B�	B�	B�	B�	Br"c���tdgd���}tj|��}|�|�d��|�d����|�|�d��|�d����Gd�d��}Gd�d	��}tj|��tj|��dS)
Nr))r*r+�agegroupr*r+r@c��eZdZdZdS)�MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonIterableFieldsN�rrr �_fieldsr!r"r#�NonIterableFieldsrB�s�������G�G�Gr"rEc��eZdZggZdS)�MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonHashableFieldsNrCr!r"r#�NonHashableFieldsrG�s�������d�G�G�Gr"rH)rr3r��
assertLess�index)rnr)r*rErHs     r#�!test_field_order_for_named_tuplesz2TestDescriptions.test_field_order_for_named_tuples�s����H�&K�&K�&K�L�L����V�$�$��������
�+�+�Q�W�W�[�-A�-A�B�B�B��������,�,�a�g�g�j�.A�.A�B�B�B�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	��*�+�+�+�
��*�+�+�+�+�+r"c��t��}tj|��}|�|�|j��d��dS)Nz/dump(obj, /) method of _pickle.Pickler instance)rr8r9rur0r:)rnr*�ps   r#�test_bound_builtin_methodz*TestDescriptions.test_bound_builtin_method�sQ���J�J���O�A��������/�/���7�7�=�	?�	?�	?�	?�	?r"c�l�|�|�tj��d��dS)Nz0stat(path, *, dir_fd=None, follow_symlinks=True))rur0rOr�rls r#�test_module_level_callablez+TestDescriptions.test_module_level_callable�s>������/�/���8�8�>�	@�	@�	@�	@�	@r"c�l�|�|�tj��d��dS)Nz*lower(self, /) unbound builtins.str method)rur0r��lowerrls r#�"test_unbound_builtin_method_noargsz3TestDescriptions.test_unbound_builtin_method_noargs�s9������/�/��	�:�:�8�	:�	:�	:�	:�	:r"c�b�|�|�dj��d��dS)Nr&z'lower() method of builtins.str instance)rur0rRrls r#� test_bound_builtin_method_noargsz1TestDescriptions.test_bound_builtin_method_noargs�s9������/�/���9�9�5�	7�	7�	7�	7�	7r"c�X�Gd�d��}|�|�|jd��d��|�|�|j��d��|�dtjtj|������dS)Nc�$�eZdZed���ZdS)�-TestDescriptions.test_staticmethod.<locals>.Xc��	dSrhr!�r�ys  r#�smz0TestDescriptions.test_staticmethod.<locals>.X.sm�s
��%��r"N)rrr �staticmethodr\r!r"r#�XrX�s-������
�
�
��\�
�
�
r"r^r\zsm(x, y)
    A static method
zL
 |  Static methods defined here:
 |  
 |  sm(x, y)
 |      A static method
)rur2�__dict__r\r�r3r,r��rnr^s  r#�test_staticmethodz"TestDescriptions.test_staticmethod�s���	�	�	�	�	�	�	�	�
	
����0�0���D�1A�B�B�1�	2�	2�	2�	
����0�0���6�6�9�	�	�	�	
�
�
��
�[��!�!�$�$�%�%�	'�	'�	'�	'�	'r"c�X�Gd�d��}|�|�|jd��d��|�|�|j��d��|�dtjtj|������dS)Nc�$�eZdZed���ZdS)�,TestDescriptions.test_classmethod.<locals>.Xc��	dSrhr!)�clsrs  r#�cmz/TestDescriptions.test_classmethod.<locals>.X.cm�s
��$��r"N)rrr �classmethodrgr!r"r#r^rd�s-������
�
�
��[�
�
�
r"r^rgzcm(...)
    A class method
zFcm(x) class method of test.test_pydoc.test_pydoc.X
    A class method
zG
 |  Class methods defined here:
 |  
 |  cm(x)
 |      A class method
)rur2r_rgr�r3r,r�r`s  r#�test_classmethodz!TestDescriptions.test_classmethod�s���	�	�	�	�	�	�	�	�
	
����0�0���D�1A�B�B�0�	1�	1�	1�	
����0�0���6�6�9�	�	�	�	
�
�
��
�[��!�!�$�$�%�%�	'�	'�	'�	'�	'r"c��|�|�tj��d��|�|�tj��d��|�|�tj��d��|�|�tj	��d��dS)N�	numerator�realr8�obj)
rur0rrk�floatrlr�r8�
memoryviewrmrls r#�test_getset_descriptorz'TestDescriptions.test_getset_descriptor�s���	
����/�/��
�>�>��L�L�L�����/�/��
�;�;�V�D�D�D�����/�/�	��?�?��H�H�H�����/�/�
��?�?��G�G�G�G�Gr"c��|�|�tj��d��|�|�tj��d��|�|�tj��d��|�|�tj��d��|�|�tj
��d��dS)Nrl�start�fget�value)rur0�complexrl�rangerr�slice�propertyrs�
StopIterationrtrls r#�test_member_descriptorz'TestDescriptions.test_member_descriptor�s���	
����/�/���=�=�v�F�F�F�����/�/���<�<�g�F�F�F�����/�/���<�<�g�F�F�F�����/�/��
�>�>��G�G�G�����/�/�
�0C�D�D�g�N�N�N�N�Nr"c�|�Gd�d��}|�|�|j��d��dS)Nc��eZdZdZdS)�4TestDescriptions.test_slot_descriptor.<locals>.PointrZN)rrr �	__slots__r!r"r#�Pointr}s������ �I�I�Ir"rr)rur0r)rnrs  r#�test_slot_descriptorz%TestDescriptions.test_slot_descriptorsV��	!�	!�	!�	!�	!�	!�	!�	!�����/�/���8�8�#�>�>�>�>�>r"c��Gd�d��}|�|�|jd��d��dS)Nc��eZdZdS)�6TestDescriptions.test_dict_attr_descriptor.<locals>.NSNrr!r"r#�NSr�r�r"r�r_)rur0r_)rnr�s  r#�test_dict_attr_descriptorz*TestDescriptions.test_dict_attr_descriptor
sf��	�	�	�	�	�	�	�	�����/�/���J�0G�H�H�#�	%�	%�	%�	%�	%r"c�.�|�|�ttj��j��d��|�|�ttj��j��d��|�|�ttj��j	��d��|�|�ttj
��j��d��dS)N�width�debug�major�max)rur0r�r��	hash_infor��flagsr��version_infor��
float_infor�rls r#� test_structseq_member_descriptorz1TestDescriptions.test_structseq_member_descriptors�������/�/��S�]�0C�0C�0I�J�J� �	"�	"�	"�����/�/��S�Y���0E�F�F� �	"�	"�	"�����/�/��S�5E�0F�0F�0L�M�M� �	"�	"�	"�����/�/��S�^�0D�0D�0H�I�I��	 �	 �	 �	 �	 r"c��tdd��}|�|�|j��d��dS)N�Box)r��heightz    Alias for field number 0
)rrur2r�)rnr�s  r#� test_namedtuple_field_descriptorz1TestDescriptions.test_namedtuple_field_descriptorsK���� 3�4�4������0�0���;�;�>�	�	�	�	�	r"c���Gd�d��}|�|�|j��d��|�dt	jt	j|������dS)Nc�$�eZdZed���ZdS)�,TestDescriptions.test_property.<locals>.Rectc�"�	|j|jzSrh)r9�hrls r#�areaz1TestDescriptions.test_property.<locals>.Rect.area&s��&��v����&r"N)rrr rxr�r!r"r#�Rectr�%s-������
�
'�
'��X�
'�
'�
'r"r�z    Area of the rect
z#
 |  area
 |      Area of the rect
)rur2r�r�r3r,r�)rnr�s  r#�
test_propertyzTestDescriptions.test_property#s���	'�	'�	'�	'�	'�	'�	'�	'�	
����0�0���;�;�>�	�	�	�	
�
�
���[��!�$�'�'�(�(�	*�	*�	*�	*�	*r"c���Gd�d���G�fd�d��}|�|�|j��dt�d���d|j_|�|�|j��dt�d���d	|j_|�|�|j��d
��dS)Nc��eZdZd�ZdS)�?TestDescriptions.test_custom_non_data_descriptor.<locals>.Descrc��|�|SdS�Nr�r!�rnrmrfs   r#�__get__zGTestDescriptions.test_custom_non_data_descriptor.<locals>.Descr.__get__6����;��K��rr"N)rrr r�r!r"r#�Descrr�5s#������
�
�
�
�
r"r�c�$��eZdZ���ZdS)�;TestDescriptions.test_custom_non_data_descriptor.<locals>.XN�rrr �attr�r�s�r#r^r�:���������5�7�7�D�D�Dr"r^razH.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>�Custom descriptorz_.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>
    Custom descriptor
rzfoo(...)
    Custom descriptor
)rur2r�rr��rnr^r�s  @r#�test_custom_non_data_descriptorz0TestDescriptions.test_custom_non_data_descriptor3s7���	�	�	�	�	�	�	�	�
	�	�	�	�	�	�	�	�	�	�	
����0�0���8�8�;W�
�;W�;W�;W�	X�	X�	X�-��������0�0���8�8�;�
�;�;�;�	�	�	�
 ��������0�0���8�8�;�	�	�	�	�	r"c���Gd�d���G�fd�d��}|�|�|j��d��d|j_|�|�|j��d��d|j_|�|�|j��d	��dS)
Nc��eZdZd�Zd�ZdS)�;TestDescriptions.test_custom_data_descriptor.<locals>.Descrc��|�|SdSr�r!r�s   r#r�zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__get__Or�r"c��ddzdS)Nr�rr!r�s   r#�__set__zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__set__Ss���!����r"N)rrr r�r�r!r"r#r�r�Ns2������
�
�
�
�
�
�
�
r"r�c�$��eZdZ���ZdS)�7TestDescriptions.test_custom_data_descriptor.<locals>.XNr�r�s�r#r^r�Ur�r"r^r&r�z    Custom descriptor
rzfoo
    Custom descriptor
)rur2r�r�rr�s  @r#�test_custom_data_descriptorz,TestDescriptions.test_custom_data_descriptorLs���	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	
����0�0���8�8�"�=�=�=�,��������0�0���8�8�;�	�	�	� ��������0�0���8�8�;�	�	�	�	�	r"c�"�dtfd�}tjtj�|����}|�d|��tj���|��}|�d|��dS)Nrc��
K�dSrr!)�igns r#�
coro_functionz=TestDescriptions.test_async_annotation.<locals>.coro_functionfs�����1r"zasync coro_functionz4async <a name="-coro_function"><strong>coro_function)rr3r,r�documentr�rA)rnr�rYrbs    r#�test_async_annotationz&TestDescriptions.test_async_annotationes���	��	�	�	�	��{�5�?�3�3�M�B�B�C�C���
�
�+�T�2�2�2��}���'�'�
�6�6���
�
�B��	�	�	�	�	r"c��d�}tjtj�|����}|�d|��tj���|��}|�d|��dS)Nc�K�dWV�dSrr!r!r"r#�an_async_generatorzLTestDescriptions.test_async_generator_annotation.<locals>.an_async_generatorrs�����G�G�G�G�G�Gr"zasync an_async_generatorz>async <a name="-an_async_generator"><strong>an_async_generator)r3r,rr�r�rA)rnr�rYrbs    r#�test_async_generator_annotationz0TestDescriptions.test_async_generator_annotationqs���	�	�	��{�5�?�3�3�4F�G�G�H�H���
�
�0�$�7�7�7��}���'�'�(:�;�;���
�
�L��	�	�	�	�	r"c��d�}tj���|��}|�d|��dS)Nc��	dSrhr!r!r"r#�a_fn_with_https_linkzHTestDescriptions.test_html_for_https_links.<locals>.a_fn_with_https_links
��+��Dr"z3<a href="https://localhost/">https://localhost/</a>)r3rAr�r�)rnr�rbs   r#�test_html_for_https_linksz*TestDescriptions.test_html_for_https_links}sS��	�	�	��}���'�'�(<�=�=���
�
�A��	
�	
�	
�	
�	
r"N)$rrr r�r�rrrrr)r]r0r2r6rr;r>rKrNrPrSrUrarirprzr�r�r�r�r�r�r�r�r�r�r!r"r#r�r�1s�������*�*�*�
5�5�5�
E�
E�
E�
P�
P�
P�H�H�H�
R�
R�
R�C�C�C�"����\���$�$��\�$� � � ��A�A���A�
B�B�B�,�,�,� �?�?���?��@�@���@�:�:�:�7�7�7��'�'���'�(�'�'���'�(�H�H���H��O�O���O��?�?���?�
�%�%���%�� � ��� ��������
*�
*���
*�������0������0
�
�
�
�
�
��	
�	
���	
�	
�	
r"r�c�T�eZdZd�Zejfd�Zejfd�Zd�Zd�Z	d�Z
d�ZdS)	�PydocFodderTestc��|���}d\}}|�|�|��}|�|�||��}|||�S)N)rN)r�rJ)rnrY�	beginline�endliner/�
beginindex�endindexs       r#�
getsectionzPydocFodderTest.getsection�s[�����!�!��&��
�H�� ����Y�/�/�J����{�{�7�J�7�7�H��Z��(�)�)r"c�$�tj��}|�|��}t|��}|tjurdnd}|�|d|�d�d��}|�d|��|�d|��|�d|��|�d	|��|�d
|��|�d|��|�d|��|�d
|��|�d|��|�|d|�d�d��}|�d|��|tjurdnd}|�d|z|��|�d|��|�d|��|�d|��|�|d|�d�d��}|�d|��|�d|��dS)N�defined here�inherited from Bz |  Methods �:zJ |  ----------------------------------------------------------------------z# |  A_method_alias = A_method(self)z# |  B_method_alias = B_method(self)z; |  A_staticmethod(x, y) from test.test_pydoc.pydocfodder.Az/ |  A_staticmethod_alias = A_staticmethod(x, y)z6 |  global_func(x, y) from test.test_pydoc.pydocfodderz) |  global_func_alias = global_func(x, y)zL |  global_func2_alias = global_func2(x, y) from test.test_pydoc.pydocfodderz* |  __repr__(self, /) from builtins.objectz# |  object_repr = __repr__(self, /)z |  Static methods zV |  A_classmethod_ref = A_classmethod(x) class method of test.test_pydoc.pydocfodder.Ar&�. class method of test.test_pydoc.pydocfodder.Bz( |  B_classmethod_ref = B_classmethod(x)zN |  A_method_ref = A_method() method of test.test_pydoc.pydocfodder.A instancez> |  get(key, default=None, /) method of builtins.dict instancezI |  dict_get = get(key, default=None, /) method of builtins.dict instancez |  Class methods z |  B_classmethod(x)z* |  B_classmethod_alias = B_classmethod(x))r3rSr�rLrr�r�r��rnrfrErx�wherer/�notes       r#�test_text_doc_routines_in_classz/PydocFodderTest.test_text_doc_routines_in_class�s���m�o�o�����c�"�"���F�#�#��"%���"6�"6���<N������(?�u�(?�(?�(?��Q�Q���
�
�;�U�C�C�C��
�
�;�U�C�C�C��
�
�S�UZ�[�[�[��
�
�G��O�O�O��
�
�N�PU�V�V�V��
�
�A�5�I�I�I��
�
�d�fk�l�l�l��
�
�B�E�J�J�J��
�
�;�U�C�C�C�����(F�e�(F�(F�(F��X�X���
�
�n�pu�v�v�v��K�M�)�)�r�r�/_���
�
�@�4�G��O�O�O��
�
�f�hm�n�n�n��
�
�V�X]�^�^�^��
�
�a�ch�i�i�i�����(E�U�(E�(E�(E��W�W���
�
�,�e�4�4�4��
�
�B�E�J�J�J�J�Jr"c���tj��}|�|��}t|��}|tjurdnd}|�|d|�d�d��}|�d|��|�d|��|�d|��|�d	|��|�d
|��|�d|��|�d|��|�d
|��|�d|��|�|d|�d�d��}|�d|��|tjurdnd}|�d|z|��|�d|��|�|d|�d�d��}|�d|��|�d|��dS)Nr�r�zMethods r�r_zA_method_alias = A_method(self)zB_method_alias = B_method(self)z7A_staticmethod(x, y) from test.test_pydoc.pydocfodder.Az+A_staticmethod_alias = A_staticmethod(x, y)z2global_func(x, y) from test.test_pydoc.pydocfodderz%global_func_alias = global_func(x, y)zHglobal_func2_alias = global_func2(x, y) from test.test_pydoc.pydocfodderz&__repr__(self, /) from builtins.objectzobject_repr = __repr__(self, /)zStatic methods zRA_classmethod_ref = A_classmethod(x) class method of test.test_pydoc.pydocfodder.Ar&r�z$B_classmethod_ref = B_classmethod(x)zJA_method_ref = A_method() method of test.test_pydoc.pydocfodder.A instancezClass methods zB_classmethod(x)z&B_classmethod_alias = B_classmethod(x))r3rAr�rcrr�r�r�r�s       r#�test_html_doc_routines_in_classz/PydocFodderTest.test_html_doc_routines_in_class�s����m�o�o�����c�"�"���6�"�"��"%���"6�"6���<N������(;�5�(;�(;�(;�V�D�D���
�
�7��?�?�?��
�
�7��?�?�?��
�
�O�QV�W�W�W��
�
�C�U�K�K�K��
�
�J�E�R�R�R��
�
�=�u�E�E�E��
�
�`�bg�h�h�h��
�
�>��F�F�F��
�
�7��?�?�?�����(B�%�(B�(B�(B�F�K�K���
�
�j�lq�r�r�r��K�M�)�)�r�r�/_���
�
�<�t�C�U�K�K�K��
�
�b�di�j�j�j�����(A��(A�(A�(A�6�J�J���
�
�(�%�0�0�0��
�
�>��F�F�F�F�Fr"c�D�|�tj��dSrh)r�r�Drls r#�)test_text_doc_inherited_routines_in_classz9PydocFodderTest.test_text_doc_inherited_routines_in_class�����,�,�[�]�;�;�;�;�;r"c�D�|�tj��dSrh)r�rr�rls r#�)test_html_doc_inherited_routines_in_classz9PydocFodderTest.test_html_doc_inherited_routines_in_class�r�r"c�@�tj��}|�t��}t	|��}|�|dd��}|�d|��|�d|��|�d|��|�d|��|�d|��|�d|��|�d	|��|�d
|��|�d|��|�d|��|�d
|��|�d|��|�d|��|�d|��|�d|��dS)N�	FUNCTIONS�FILEz)    global_func_alias = global_func(x, y)z    A_staticmethod(x, y)z/    A_staticmethod_alias = A_staticmethod(x, y)z&    A_classmethod(x) class method of Az7    A_classmethod2 = A_classmethod(x) class method of Az7    A_classmethod3 = A_classmethod(x) class method of Bz#    A_method() method of A instancez/    A_method2 = A_method() method of A instancez/    A_method3 = A_method() method of B instancez-    A_staticmethod_ref = A_staticmethod(x, y)z@    A_staticmethod_ref2 = A_staticmethod(y) method of B instancez>    get(key, default=None, /) method of builtins.dict instancezI    dict_get = get(key, default=None, /) method of builtins.dict instancez    B_method(self)z    B_method2 = B_method(self))r3rSrBrrLr�r��rnrErxr/s    r#� test_text_doc_routines_in_modulez0PydocFodderTest.test_text_doc_routines_in_module�s����m�o�o�����{�+�+���F�#�#�������V�<�<���
�
�A�5�I�I�I��
�
�0�%�8�8�8��
�
�G��O�O�O��
�
�>��F�F�F��
�
�O�QV�W�W�W��
�
�O�QV�W�W�W��
�
�;�U�C�C�C��
�
�G��O�O�O��
�
�G��O�O�O��
�
�E�u�M�M�M��
�
�X�Z_�`�`�`��
�
�V�X]�^�^�^��
�
�a�ch�i�i�i��
�
�*�E�2�2�2��
�
�6��>�>�>�>�>r"c�@�tj��}|�t��}t	|��}|�|dd��}|�d|��|�d|��|�d|��|�d|��|�d|��|�d|��|�d|��|�d	|��|�d
|��|�d|��|�d|��|�d
|��|�d|��|�d|��|�d|��dS)Nz
 Functionsz& global_func_alias = global_func(x, y)z A_staticmethod(x, y)z, A_staticmethod_alias = A_staticmethod(x, y)z"A_classmethod(x) class method of Az4 A_classmethod2 = A_classmethod(x) class method of Az4 A_classmethod3 = A_classmethod(x) class method of Bz  A_method() method of A instancez, A_method2 = A_method() method of A instancez, A_method3 = A_method() method of B instancez* A_staticmethod_ref = A_staticmethod(x, y)z= A_staticmethod_ref2 = A_staticmethod(y) method of B instancez; get(key, default=None, /) method of builtins.dict instancezF dict_get = get(key, default=None, /) method of builtins.dict instancez B_method(self)z B_method2 = B_method(self))r3rArBrrcr�r�r�s    r#� test_html_doc_routines_in_modulez0PydocFodderTest.test_html_doc_routines_in_module�s����m�o�o�����{�+�+���6�"�"�������d�;�;���
�
�>��F�F�F��
�
�-�u�5�5�5��
�
�D�e�L�L�L��
�
�:�E�B�B�B��
�
�L�e�T�T�T��
�
�L�e�T�T�T��
�
�8�%�@�@�@��
�
�D�e�L�L�L��
�
�D�e�L�L�L��
�
�B�E�J�J�J��
�
�U�W\�]�]�]��
�
�S�UZ�[�[�[��
�
�^�`e�f�f�f��
�
�'��/�/�/��
�
�3�U�;�;�;�;�;r"N)rrr r�rr�r�r�r�r�r�r�r!r"r#r�r��s�������*�*�*�3>�-�K�K�K�K�83>�-�G�G�G�G�4<�<�<�<�<�<�?�?�?�2<�<�<�<�<r"r�z/Socket server not available on Emscripten/WASI.c��eZdZ	d�ZdS)�PydocServerTestc	�d��d�}tj|dd����|��jd��|��j��|��fd���|�d�j��|�t��|�dttj�
�jd���������|�dttj�
�jd	�������������|��j��|��j��|��j��dS)
Nc��d|�d|�d�}|S)Nzthe URL sent was: (z, �)r!)rv�content_typerYs   r#�my_url_handlerz3PydocServerTest.test_server.<locals>.my_url_handlers���36�3�3����E�D��Kr"�	localhostr)�hostname�portc�>���jr����ndSrh)�serving�stop)�serverthreads�r#rz-PydocServerTest.test_server.<locals>.<lambda>s ���<�+?�I�L�%�%�'�'�'�T�r"s$the URL sent was: (/test, text/html)z/tests'the URL sent was: (/test.css, text/css)z	/test.css)r3�
_start_serverru�errorrer�r=r�rvrrr�r��urljoin�readr�r_rS�	docserver)rnr�r�s  @r#�test_serverzPydocServerTest.test_servers����	�	�	��*�� ������
	
����+�T�2�2�2�����,�-�-�-����I�I�I�I�	�	�	�	
�
�
�k�<�#3�4�4�4����
�#�#�#����3��F�L�(�(��)9�7�C�C�D�D�I�I�K�K�	�	�	�	
���6��F�L�(�(��)9�;�G�G�H�H�M�M�O�O�	�	�	�
	����������-�.�.�.����,�0�1�1�1����,�*�+�+�+�+�+r"N)rrr r�r!r"r#r�r�s(������
(� ,� ,� ,� ,� ,r"r�c��eZdZ	d�Zd�ZdS)�PydocUrlHandlerTestc��tj}|�t|dd��|�t|dd��dS)Nr�r&r��foobar)r3rtr'�	TypeError)rnr�s  r#�test_content_type_errz)PydocUrlHandlerTest.test_content_type_err1sD��������)�Q��R�0�0�0����)�Q��X�6�6�6�6�6r"c��gd�}|���5|D]\}}|�||���	ddd��dS#1swxYwYdS)N))r&�Pydoc: Index of Modules)zget?key=r)rJr)�topicsz
Pydoc: Topics)�keywordszPydoc: Keywords)r3�Pydoc: module pydoc)z
get?key=pydocr)zsearch?key=pydocr�)z
topic?key=defzPydoc: KEYWORD def)ztopic?key=STRINGSzPydoc: TOPIC STRINGS)r�zPydoc: Error - foobar)rrry)rn�requestsrvr\s    r#�test_url_requestsz%PydocUrlHandlerTest.test_url_requests6s��������
(�
(�
*�
*�	2�	2�&�
2�
2�
��U��%�%�c�5�1�1�1�1�
2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2����	2�	2�	2�	2�	2�	2s�A�A
�
A
N)rrr r�rr!r"r#r�r�.s5������&�7�7�7�
2�2�2�2�2r"r�c��eZdZd�ZdS)�
TestHelperc��|�ttjj��tt
j����dSrh)ru�sortedr3r�r�keyword�kwlistrls r#�
test_keywordszTestHelper.test_keywordsNs@�������� 5�6�6����/�/�	1�	1�	1�	1�	1r"N)rrr rr!r"r#rrMs#������1�1�1�1�1r"rc���eZdZejeed��oej��d��ed�����Z	ejeed��oej��d��ed�����Z
ejeed��oej��d��ed�����Zejeed��oej��d��ed�����Zd�Z
dS)	�PydocWithMetaClassesr~rc��Gd�dt��}Gd�d|���}td�tD����}t��}t	j|���}||��ttf|dd�zz}|����	��}|�
||��dS)	Nc���eZdZ�fd�Z�xZS)�=PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Metac�V��|dkrdSt���|��S)N�ham�spam��super�__getattr__�rnr(ros  �r#rzIPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Meta.__getattr__Ys)����5�=�=�!�6��w�w�*�*�4�0�0�0r")rrr r�
__classcell__�ros@r#�MetarXs8�������
1�
1�
1�
1�
1�
1�
1�
1�
1r"rc�.�eZdZejd���ZdS)�;PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DAc��dS)N�eggsr!rls r#rz?PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DA.ham^s���vr"N)rrr r�DynamicClassAttributerr!r"r#�DAr]s1������
�
(�
�
�)�
(�
�
�
r"r!��	metaclassc3�(K�|]
}|rd|zndV��dS)z	
 |      r&Nr!r(s  r#r+zBPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.<genexpr>asO����.I�.I�*+�CD�.K�l�Q�.>�.>��.I�.I�.I�.I�.I�.Ir"r�r�)r�r��expected_data_docstringsrr3r��!expected_dynamicattribute_patternrr�r5ru)rnrr!r�rFr�r�rxs        r#�test_DynamicClassAttributez/PydocWithMetaClasses.test_DynamicClassAttributeTs��	1�	1�	1�	1�	1�4�	1�	1�	1�
	�	�	�	�	�4�	�	�	�	�).�.I�.I�/G�.I�.I�.I�)I�)I�%�������V�,�,�,����r�
�
�
�9���;�B�Q�B�?�?�A�
����"�"�(�(�*�*�������/�/�/�/�/r"c�<�Gd�dt��}Gd�d|���}t��}tj|���}||��tt
z}|������}|�||��dS)Nc�$��eZdZd�Z�fd�Z�xZS)�HPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Metac�
�gd�S)N)rorr�LIFEr!�rfs r#�__dir__zPPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__dir__ps��F�F�F�Fr"c�V��|dkrdSt���|��S)Nr,r�)r�_Meta__getattrrs  �r#rzTPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__getattr__rs)����&�=�=��2��w�w�(�(��.�.�.r"�rrr r.rrrs@r#rr*osJ�������
G�
G�
G�
/�
/�
/�
/�
/�
/�
/�
/�
/r"rc��eZdZdS)�IPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.ClassNrr!r"r#�Classr3vr�r"r4r"r�)	r�rr3r��"expected_virtualattribute_pattern1rr�r5ru)rnrr4rFr�r�rxs       r#�%test_virtualClassAttributeWithOneMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithOneMetaks���	/�	/�	/�	/�	/�4�	/�	/�	/�	�	�	�	�	�d�	�	�	�	�������V�,�,�,����u�
�
�
�:�X�E�
����"�"�(�(�*�*�������/�/�/�/�/r"c��
��Gd�dt���
Gd�dt���G�
�fd�d�
���}Gd�d�
�	��}Gd
�d||�	��}t��}tj|���}||��tt
z}|������}|�||��t��}tj|���}||��tt
z}|������}	|�||	��dS)
Nc�$��eZdZd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1c�
�gd�S)N)rorrr�r!r-s r#r.zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__dir__����E�E�E�Er"c�V��|dkrdSt���|��S)Nr�r�rrs  �r#rzUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__getattr__��)����%�<�<��1��w�w�*�*�4�0�0�0r"r1rs@r#�Meta1r9��J�������
F�
F�
F�
1�
1�
1�
1�
1�
1�
1�
1�
1r"r>c�$��eZdZd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2c�
�gd�S)N)rorr�twor!r-s r#r.zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__dir__�r;r"c�V��|dkrdSt���|��S)NrCr�rrs  �r#rzUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__getattr__�r=r"r1rs@r#�Meta2rA�r?r"rEc�,���eZdZ��fd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3c
���tttgd���|��z��|��z������S)N)rorr�three)rr	�setr.)rfr>rEs ��r#r.zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__dir__�s^����F�3�D�D�D��M�M�#�&�&�'�).���s�);�);�<�$=�$=�>�>�?�?�?r"c�V��|dkrdSt���|��S)NrIr�rrs  �r#rzUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__getattr__�s)����'�>�>��1��w�w�*�*�4�0�0�0r"r1)ror>rEs@��r#�Meta3rG�sW��������
?�
?�
?�
?�
?�
?�
1�
1�
1�
1�
1�
1�
1�
1�
1r"rLc��eZdZdS)�JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class1Nrr!r"r#�Class1rN�r�r"rOr"c��eZdZdS)�JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class2Nrr!r"r#�Class2rQ�r�r"rRr�)
r�rr3r��"expected_virtualattribute_pattern2rr�r5ru�"expected_virtualattribute_pattern3)rnrLrOrRrFr��expected_text1�result1�expected_text2�result2r>rEs          @@r#�%test_virtualClassAttributeWithTwoMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithTwoMetas�����	1�	1�	1�	1�	1�D�	1�	1�	1�	1�	1�	1�	1�	1�D�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�E�5�	1�	1�	1�	�	�	�	�	�u�	�	�	�	�	�	�	�	�	�V�u�	�	�	�	�������V�,�,�,����v����;�h�F���/�/�#�#�)�)�+�+�������1�1�1�������V�,�,�,����v����;�h�F���/�/�#�#�)�)�+�+�������1�1�1�1�1r"c�<�Gd�dt��}Gd�d|���}t��}tj|���}||��tt
z}|������}|�||��dS)Nc��eZdZd�ZdS)�.PydocWithMetaClasses.test_buggy_dir.<locals>.Mc�
�gd�S)N)ror�missing�herer!r-s r#r.z6PydocWithMetaClasses.test_buggy_dir.<locals>.M.__dir__�s��C�C�C�Cr"N)rrr r.r!r"r#�Mr\�s(������
D�
D�
D�
D�
Dr"r`c��eZdZdZdS)�.PydocWithMetaClasses.test_buggy_dir.<locals>.Czpresent!N)rrr r_r!r"r#r�rb�s�������D�D�Dr"r�r"r�)	r�rr3r��!expected_missingattribute_patternrr�r5ru)rnr`r�rFr�r�rxs       r#�test_buggy_dirz#PydocWithMetaClasses.test_buggy_dir�s���	D�	D�	D�	D�	D��	D�	D�	D�	�	�	�	�	�!�	�	�	�	�������V�,�,�,����q�	�	�	�9�H�D�
����"�"�(�(�*�*�������/�/�/�/�/r"c���t��5}tjd��ddd��n#1swxYwY|���}|�d|��dS)Nz	enum.Enumz
class Enum)rr3r�r�r�)rnrrs   r#�test_resolve_falsez'PydocWithMetaClasses.test_resolve_false�s����
�
�	$�'��J�{�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$��#�#�%�%���
�
�l�H�-�-�-�-�-s�0�4�4N)rrr r�r�r�r�r~rr'r6rYrdrfr!r"r#rrSs��������X�_�W�W�S�*�-�-�@�,�#�,�.�.�H�J�J��0�0���J�J�0�(�X�_�W�W�S�*�-�-�@�,�#�,�.�.�H�J�J��0�0���J�J�0�"�X�_�W�W�S�*�-�-�@�,�#�,�.�.�H�J�J��'2�'2���J�J�'2�R�X�_�W�W�S�*�-�-�@�,�#�,�.�.�H�J�J��0�0���J�J�0�.�.�.�.�.r"rc�:�eZdZd�Zd	d�Zd�Zd�Zd�Zd�Zd�Z	dS)
�TestInternalUtilitiesc�(�tj��}|j|_tj�|jd��|_|�|j	��t	j
��x|_}dtj|g|_
dS)N�nonexistentr&)�tempfile�TemporaryDirectoryr(�argv0dirrOrPrL�argv0r=�cleanup�getcwd�
abs_curdir�curdir�curdir_spellings)rn�tmpdirrqs   r#r�zTestInternalUtilities.setUp�so���,�.�.�����
��W�\�\�&�+�}�=�=��
������'�'�'�')�y�{�{�2���*�!#�R�Y�
� ;����r"Nc�>�|�|j}tj||��Srh)rnr3�_get_revised_path)rn�
given_pathrns   r#rvz'TestInternalUtilities._get_revised_path�s#���=��J�E��&�z�5�9�9�9r"c���tj���}|jD]<}t	|�|����D]}|�|����=|Srh)r�rP�copyrsrv�countrf)rn�
clean_path�spelling�__s    r#�_get_starting_pathz(TestInternalUtilities._get_starting_path�sj���X�]�]�_�_�
��-�	,�	,�H��J�,�,�X�6�6�7�7�
,�
,���!�!�(�+�+�+�+�
,��r"c��|���}|jg|z}|�|�|��|��dSrh)r~rqrurv)rnr{�
expected_paths   r#�,test_sys_path_adjustment_adds_missing_curdirzBTestInternalUtilities.test_sys_path_adjustment_adds_missing_curdir�sL���,�,�.�.�
���)�J�6�
�����/�/�
�;�;�]�K�K�K�K�Kr"c��|���}|jg|z}|jg|z}|�|�|��|��||jgz}|�|�|��|��dSrh)r~rqrmrurv)rnr{r��leading_argv0dir�trailing_argv0dirs     r#�*test_sys_path_adjustment_removes_argv0_dirz@TestInternalUtilities.test_sys_path_adjustment_removes_argv0_dir�s����,�,�.�.�
���)�J�6�
� �M�?�Z�7������/�/�0@�A�A�=�Q�Q�Q�&�$�-��8������/�/�0A�B�B�M�R�R�R�R�Rr"c����fd�}����}�jg|z}�jg|z}��||��|��|�jgz}�jg|z}��||��|��dS)Nc�F����|tj���S)N)rn)rvr3r4)rwrns �r#rvz\TestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir.<locals>._get_revised_path�s����)�)�*�E�N�)�K�K�Kr")r~rmrqru)rnrvr{r�r�r�s`     r#�+test_sys_path_adjustment_protects_pydoc_dirzATestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir�s����	L�	L�	L�	L�	L��,�,�.�.�
� �M�?�Z�7����)�,<�<�
����*�*�+;�<�<�m�L�L�L�&�$�-��8����)�,=�=�
����*�*�+<�=�=�}�M�M�M�M�Mr"c�"�|���}|jD]�}|�|���5|g|z}|�|�|����||gz}|�|�|����|jg|z}|�|�|����||jgz}|�|�|����ddd��n#1swxYwY��dS)N)�curdir_spelling)r~rs�subTestrSrvrm)rnr{r|�leading_curdir�trailing_curdirr�r�s       r#�5test_sys_path_adjustment_when_curdir_already_includedzKTestInternalUtilities.test_sys_path_adjustment_when_curdir_already_included�sn���,�,�.�.�
��-�
	M�
	M�H����h��7�7�	
M�	
M�"*��j�!8���!�!�$�"8�"8��"H�"H�I�I�I�",��z�"9���!�!�$�"8�"8��"I�"I�J�J�J�$(�M�?�^�#C� ��!�!�$�"8�"8�9I�"J�"J�K�K�K�$3�t�}�o�$E�!��!�!�$�"8�"8�9J�"K�"K�L�L�L�	
M�	
M�	
M�	
M�	
M�	
M�	
M�	
M�	
M�	
M�	
M����	
M�	
M�	
M�	
M��
	M�
	Ms�CD�D	�
D	rh)
rrr r�rvr~r�r�r�r�r!r"r#rhrh�s�������<�<�<�:�:�:�:����L�L�L�
S�S�S�	N�	N�	N�M�M�M�M�Mr"rhc��tj��}tjtjg|�R�tjt
��dSrh)r
�threading_setupr��addModuleCleanup�threading_cleanupr)�thread_infos r#�setUpModuler�sD��"�2�4�4�K���.�@�O�;�O�O�O�O���m�,�,�,�,�,r"�__main__)`rOr�rz�importlib.utilrMr�r3rQr
r8rqrJr�rk�test.support�testrrr��urllib.parser��	xml.etreer��xml.etree.ElementTreer�ior�collectionsr�urllib.requestrrrrr	�test.support.script_helperr
rrr
rrrrrrrr�test.support.os_helperrrr�test.test_pydocrrr�HAVE_DOCSTRINGSr%r5r�r�r�r��expected_html_data_docstringsr/r�r�r�r&r5rSrTrcr=r?rHrLrTrVr]rc�TestCaserer}r�r�r�r�r�r�rrrhr�r�mainr!r"r#�<module>r�s���	�	�	�	�
�
�
�
���������������������������������	�	�	�	�����������������
�
�
�
���������������������������"�"�"�"�"�"�.�.�.�.�.�.�.�.�������&�&�&�&�&�&�"�"�"�"�"�"�M�M�M�M�M�M�M�M�M�M�)�)�)�)�)�)�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�<�;�;�;�;�;�;�;�;�;�%�%�%�%�%�%�'�'�'�'�'�'�	�	�	�	�	�	�	�	��<��0� ���
 0��\�x
�E�G�G�y�|!&��&I�&I�/G�&I�&I�&I�!I�!I��M��^!&��&I�&I�/G�&I�&I�&I�!I�!I��,�-4�G�D�"�*�,E�,E��N��%� 
�E�G�G�!"�$&�
�E�G�G�#�&�
�E�G�G�#�&�,
�E�G�G�-#�0%�
�E�G�G�"����������"�"�"����	�	�	����	�	�	������H�%����<z3�z3�z3�z3�z3�8�$�z3�z3�z3�zX@�X@�X@�X@�X@�m�X@�X@�X@�vV
�V
�V
�V
�V
�x�(�V
�V
�V
�r
w<�w<�w<�w<�w<�h�'�w<�w<�w<�t�����W�5���#,�#,�#,�#,�#,�h�'�#,�#,�	��#,�L2�2�2�2�2�-�2�2�2�>1�1�1�1�1��"�1�1�1�n.�n.�n.�n.�n.�8�,�n.�n.�n.�b=M�=M�=M�=M�=M�H�-�=M�=M�=M�@-�-�-��z����H�M�O�O�O�O�O��r"