Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_pydoc.cpython-311.pyc
�

�Ke������ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZmZddlm Z ddlm!Z!ddl"m#Z#m$Z$ddlm%Z%dd	lm&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,dd
l-m.Z.m/Z/m0Z0ddlm1Z1Gd�d
��Z2ej3j4rdZ5ndZ5d�6��Z7e8d�e5D����Z9dZ:e8d�e5D����Z;d�<dej=��Z>dZ?d�6��Z@d�6��ZAd�6��ZBd�6��ZCd�6��ZDd�ZEd�ZFd�ZGd�ZHd �ZId!�ZJd"�ZKGd#�d$ejL��ZMGd%�d&ejL��ZNGd'�d(eM��ZOGd)�d*ejL��ZPejQe*pe+d+��Gd,�d-ejL����ZRGd.�d/eM��ZSGd0�d1ejL��ZTGd2�d3ejL��ZUGd4�d5ejL��ZVd6�ZWeXd7krejY��dSdS)8�N)�StringIO)�
namedtuple)�urlopen�
urlcleanup)�
import_helper)�	os_helper)�assert_python_ok�assert_python_failure)�threading_helper)�
reap_children�captured_output�captured_stdout�captured_stderr�
is_emscripten�is_wasi�requires_docstrings)�TESTFN�rmtree�unlink)�	pydoc_modc��eZdZdZdS)�nonasciiuЦе не латиницяN��__name__�
__module__�__qualname__�__doc__���9/usr/local/apps/python3/lib/python3.11/test/test_pydoc.pyrr$s������ � ��Drr)�.dictionary for instance variables (if defined)�2list of weak references to the object (if defined)r!r")�r#r#r#a�
NAME
    test.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) from builtins.type
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)

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.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�&Ira�
test.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 (if defined)
        __weakref__
            list of weak references to the object (if defined)

class B(builtins.object)
    Data descriptors defined here:
        __dict__
            dictionary for instance variables (if defined)
        __weakref__
            list of weak references to the object (if defined)
    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) from builtins.type
    Data descriptors defined here:
        __dict__
            dictionary for instance variables (if defined)
        __weakref__
             list of weak references to the object (if defined)

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.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�&Irz~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�t�||fz}tdtjg|�Ri|��\}}}|���S)zW
    Runs pydoc on the specified module. Returns the stripped
    output of pydoc.
    �-B)r	�pydoc�__file__�strip��module_name�args�env�rc�out�errs      r �	run_pydocr:.sE��
�;�.� �D�#�D�%�.�G�4�G�G�G�3�G�G�L�B��S��9�9�;�;�rc�t�||fz}tdtjg|�Ri|��\}}}|���S)zA
    Runs pydoc on the specified module expecting a failure.
    r/)r
r0r1r2r3s      r �run_pydoc_failr<8sE���;�.� �D�(��u�~�L��L�L�L��L�L�L�B��S��9�9�;�;�rc���tj��}|�|��}|�t��pd}|rd|zdz}|���|fS)z&Returns pydoc generated output as htmlr#z
<br><a href="z">Module Docs</a>)r0�HTMLDoc�	docmodule�	getdoclocrr2)�module�doc�output�locs    r �get_pydoc_htmlrE@s_��
�-�/�/�C�
�]�]�6�
"�
"�F�

�-�-�	�
"�
"�
(�b�C�
�<���$�';�;���<�<�>�>�3��rc���tjj}tjj}|||t������}tj��}|�||���}|S)z,Returns a documentation web link of a module)�basedir)�os�path�abspath�dirnamer1r0�TextDocr@)rArJrKrGrBrDs      r �get_pydoc_linkrMIs\���g�o�G��g�o�G��g�g�g�g�g�h�/�/�0�0�1�1�G�
�-�/�/�C�

�-�-���-�
0�
0�C��Jrc��tj��}|�t��pd}|rd|zdz}|�|��}tjd��}|�d|��}|���|fS)z&Returns pydoc generated output as textr#z
MODULE DOCS
    r-�.)	r0rLr@rr?�re�compile�subr2)rArBrDrC�patts     r �get_pydoc_textrTRs���
�-�/�/�C�

�-�-�	�
"�
"�
(�b�C�
�1�#�c�)�D�0��
�]�]�6�
"�
"�F��:�e���D�
�X�X�b�&�
!�
!�F��<�<�>�>�3��rc��|�d��\}}}|�d��\}}}|�d��\}}}|S)Nz</head>z<title>z</title>)�	partition)�text�header�_�titles    r �get_html_titler[`sN���>�>�)�,�,�L�F�A�q��"�"�9�-�-�K�A�q�%��/�/�*�-�-�K�E�1�a��Lrc	��|�dd��}tjdd|��}tj|ddddd	d
��}|S)zWA quick and dirty implementation of html2text.

    Tailored for pydoc tests only.
    z<dd>r-z<.*?>r#r+r*z&gt;�>z&lt;�<)r,rPrRr0)�htmls r �	html2textr`hsJ��
�<�<���%�%�D�
�6�'�2�t�$�$�D��=��x��f�c�6�3�G�G�D��Krc�>�eZdZdd�Zejdd���Zd�ZdS)�
PydocBaseTestNc�f���|p$tj�t��g�d��fd�	}|S)zi
        A version of pkgutil.walk_packages() that will restrict itself to
        a given path.
        Nr#c�"���|p�||��S�Nr)rI�prefix�onerror�default_path�
walk_packagess   ��r �wrapperz8PydocBaseTest._restricted_walk_packages.<locals>.wrapper{s��� �=��!5��v�w�G�G�Gr)Nr#N)rHrIrKr1)�selfrirIrjrhs `  @r �_restricted_walk_packagesz'PydocBaseTest._restricted_walk_packagesusP����
�:������ 9� 9�:��	H�	H�	H�	H�	H�	H�	H��rc#�K�tj}|�||��t_	dV�|t_dS#|t_wxYwre)�pkgutilrirl)rkrIris   r �restrict_walk_packagesz$PydocBaseTest.restrict_walk_packagess]�����-�
� $� >� >�}�?C�!E�!E���	2��E�E�E�$1�G�!�!�!��M�G�!�1�1�1�1s�A�Ac�|�tj|d��}t|��}|�|||��|S)Nz	text/html)r0�_url_handlerr[�assertEqual)rk�url�expected_titlerW�results     r �call_url_handlerzPydocBaseTest.call_url_handler�s>���!�#�{�3�3����%�%��������6�6�6��rre)rrrrl�
contextlib�contextmanagerrorvrrr rbrbss[������������2�2�2���2�����rrbc�:�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�Zejeed��oej��d��e	d�����Zd�Zd�Zd�Ze	d���Zd�Zd�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�r2�r&�lines  r �
<listcomp>z.PydocDocTest.test_html_doc.<locals>.<listcomp>�s ��H�H�H�t�d�j�j�l�l�H�H�Hrc��g|]}|�|��Srrr�s  r r�z.PydocDocTest.test_html_doc.<locals>.<listcomp>�s��:�:�:�t�T�:�d�:�:�:r�c�:�g|]}|�|�����Srrr�s  r r�z.PydocDocTest.test_html_doc.<locals>.<listcomp>�s%��J�J�J�4�T�J�$�*�*�,�,�J�J�Jr)rErr`�
splitlines�html2text_of_expectedrr�inspect�
getabsfile�urllib�parse�quote�assertIn)rkru�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�&�&�&�&�&rc��tt��\}}t|ftzt	jt��fzz}|�||��dSre)rTr�expected_text_pattern�expected_text_data_docstringsr�r�rr)rkrur��
expected_texts    r �
test_text_doczPydocDocTest.test_text_doc�s`��)��3�3����-� �
�5�6� �+�I�6�6�8�9�:�
�	
�����/�/�/�/�/rc��ddl}Gd�d|j��}tj|��}|�d|��dS)Nrc��eZdZdZdZdS)�IPydocDocTest.test_text_enum_member_with_value_zero.<locals>.BinaryIntegerrr�N)rrr�zero�onerrr �
BinaryIntegerr��s�������D��C�C�Crr�zBinaryInteger.zero)�enum�IntEnumr0�
render_docr�)rkr�r�rBs    r �%test_text_enum_member_with_value_zeroz2PydocDocTest.test_text_enum_member_with_value_zero�sf��	����	�	�	�	�	�D�L�	�	�	���}�-�-���
�
�*�C�0�0�0�0�0rc�n�ttjj��}|�d|��dS)Nzxml.etree.elementtree)rM�xml�etree�ElementTreer�)rk�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�8rc�l�ttj��\}}|�|dd��dS)Nr#z'MODULE DOCS incorrectly includes a link)rTr�r�rr)rkrur�s   r �test_issue8225zPydocDocTest.test_issue8225�s4��(���3�3��������"�&O�P�P�P�P�Prc��tj}	dt_tj��|t_dS#|t_wxYwre)�sys�stdinr0�getpager)rk�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�*N�rrrrrr �Ar��s�������H�H�Hrr�c��eZdZdS)�)PydocDocTest.test_non_str_name.<locals>.BNr�rrr �Br����������Drr�)r0r�rrr,)rkr�r��adoc�bdocs     r �test_non_str_namezPydocDocTest.test_non_str_name�s���	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�������$�$��������$�$��������c�3�/�/��6�6�6�6�6rc��d}tt|��d��}t|z}|�||d��dS)N�test.i_am_not_here�asciiz&documentation for missing module found)�strr<�missing_patternrr�rk�missing_moduleru�expecteds    r �
test_not_herezPydocDocTest.test_not_here�sQ��-���^�N�3�3�W�=�=��"�^�3������6�4�	6�	6�	6�	6�	6rc��tdd���}tj�dd��}|�||��dS)Nztest.test_pydoc.nonasciir�)�PYTHONIOENCODING�backslashreplace)r:rr�encoder�)rkru�encodeds   r �test_not_asciizPydocDocTest.test_not_ascii�sH���5��P�P�P���"�)�)�'�3E�F�F���
�
�g�v�&�&�&�&�&rc��d}tt|��d��}t|���z}|�||��dS)Nz test.i_am_not_here r�)r�r<r�r2rrr�s    r �test_input_stripzPydocDocTest.test_input_strip�sP��/���^�N�3�3�W�=�=��"�^�%9�%9�%;�%;�;������6�*�*�*�*�*rc��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'>)r0�stripidrr)rkr�s  r �test_stripidzPydocDocTest.test_stripid�s����-�������!B�C�C�-�	/�	/�	/������!C�D�D�-�	/�	/�	/�	
���������-�-�-������!@�A�A�8�	:�	:�	:�	:�	:rc��tj��}|�t��}d}|�||��dS)a�Tests help on builtin object which have more than four child classes.

        When running help() on a builtin class which has child classes, it
        should contain a "Built-in subclasses" section and only 4 classes
        should be displayed with a hint on how many more subclasses are present.
        For example:

        >>> help(object)
        Help on class object in module builtins:

        class object
         |  The most base type
         |
         |  Built-in subclasses:
         |      async_generator
         |      BaseException
         |      builtin_function_or_method
         |      bytearray
         |      ... and 82 other subclasses
        z� |  Built-in subclasses:
 |      async_generator
 |      BaseException
 |      builtin_function_or_method
 |      bytearray
 |      ... and \d+ other subclassesN)r0rL�docclass�object�assertRegex�rkrBrW�snips    r �)test_builtin_with_more_than_four_childrenz6PydocDocTest.test_builtin_with_more_than_four_children�sE��*�m�o�o���|�|�F�#�#��8��	
����t�$�$�$�$�$rc��tj��}|�t��}d}|�||��dS)a1Tests help on builtin object which have only child classes.

        When running help() on a builtin class which has child classes, it
        should contain a "Built-in subclasses" section. For example:

        >>> help(ArithmeticError)
        Help on class ArithmeticError in module builtins:

        class ArithmeticError(Exception)
         |  Base class for arithmetic errors.
         |
         ...
         |
         |  Built-in subclasses:
         |      FloatingPointError
         |      OverflowError
         |      ZeroDivisionError
        zc |  Built-in subclasses:
 |      FloatingPointError
 |      OverflowError
 |      ZeroDivisionErrorN)r0rLr��ArithmeticErrorr�r�s    r �test_builtin_with_childz$PydocDocTest.test_builtin_with_childsC��&�m�o�o���|�|�O�,�,��,��	
�
�
�d�D�!�!�!�!�!rc��tj��}|�t��}d}|�||��|�d|��dS)a�Tests help on builtin classes which have grandchild classes.

        When running help() on a builtin class which has child classes, it
        should contain a "Built-in subclasses" section. However, if it also has
        grandchildren, these should not show up on the subclasses section.
        For example:

        >>> help(Exception)
        Help on class Exception in module builtins:

        class Exception(BaseException)
         |  Common base class for all non-exit exceptions.
         |
         ...
         |
         |  Built-in subclasses:
         |      ArithmeticError
         |      AssertionError
         |      AttributeError
         ...
        z^ |  Built-in subclasses:
 |      ArithmeticError
 |      AssertionError
 |      AttributeError�ZeroDivisionErrorN)r0rLr��	Exceptionr��assertNotInr�s    r �test_builtin_with_grandchildz)PydocDocTest.test_builtin_with_grandchild3sZ��,�m�o�o���|�|�I�&�&��)��	
�
�
�d�D�!�!�!����,�d�3�3�3�3�3rc��tj��}|�t��}|�d|��dS)a�Tests help on builtin object which have no child classes.

        When running help() on a builtin class which has no child classes, it
        should not contain any "Built-in subclasses" section. For example:

        >>> help(ZeroDivisionError)

        Help on class ZeroDivisionError in module builtins:

        class ZeroDivisionError(ArithmeticError)
         |  Second argument to a division or modulo operation was zero.
         |
         |  Method resolution order:
         |      ZeroDivisionError
         |      ArithmeticError
         |      Exception
         |      BaseException
         |      object
         |
         |  Methods defined here:
         ...
        �Built-in subclassesN)r0rLr�r�r��rkrBrWs   r �test_builtin_no_childz"PydocDocTest.test_builtin_no_childSs>��.�m�o�o���|�|�-�.�.�����.��5�5�5�5�5rc��tj��}|�t��}|�d|��dS)z�Tests help on metaclasses.

        When running help() on a metaclasses such as type, it
        should not contain any "Built-in subclasses" section.
        r�N)r0rLr��typer�r�s   r �test_builtin_on_metaclassesz(PydocDocTest.test_builtin_on_metaclassesos=���m�o�o���|�|�D�!�!�����.��5�5�5�5�5rc��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��|Srer)�xs r �<lambda>zJPydocDocTest.test_help_output_redirect.<locals>.<lambda>.<locals>.<lambda>�s��!�rrrrr r�z8PydocDocTest.test_help_output_redirect.<locals>.<lambda>�s����r�rCztest.pydoc_modz9
        Help on module test.pydoc_mod in test:

        �stdout�stderrr#)r0r��maxDiffr�HelperrTr�lstrip�textwrap�dedentr�r
�help�getvaluer2r�r�r�rr)rk�getpager_old�getpager_new�buf�helper�unusedr�rA�help_header�expected_help_patternrCr9rur�s              r �test_help_output_redirectz&PydocDocTest.test_help_output_redirectzs���~��,�,������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�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�rrr0r�r�r�)rkr�help_io�helptexts    r �test_namedtuple_fieldsz#PydocDocTest.test_namedtuple_fields�s����H�z�;�&?�@�@��
�
�
�	�'��J�v����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��#�#�%�%���
�
�j�(�+�+�+��
�
�k�8�,�,�,��
�
�0�(�;�;�;��
�
�0�(�;�;�;�;�;s�A�A�	Ac�N�tdddgd���}t��5}tj|��ddd��n#1swxYwY|���}|�d|��|�d|��|�d|��dS)	N�NT�abc�defT)�rename�_1�_replace�_asdictr)rkr
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��encodingrz#coding: {})�fileu"""line 1: héz
line 2: hi"""uline 1: hé)	�
addCleanuprr�open�print�formatr0�synopsisrr)rkr�scriptrs    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)NrHr)r�import_fresh_modulerr��
__cached__r0rrr)rkrHr��filenamers     r �test_synopsis_sourcelessz%PydocDocTest.test_synopsis_sourceless�s\��
�
.�t�
4�
4���:�(�(�*�*�1�-���=���>�(�+�+������8�,�,�,�,�,rc�&�tj��5}tj�|d��}t
j�|��}t|d��5}|�	d��ddd��n#1swxYwYtj|��tj
|i��}|�|��tj
|i��}|�|��ddd��dS#1swxYwYdS)Nzfoomod42.pyr�foo = 1)r�temp_cwdrHrI�join�	importlib�util�cache_from_sourcer�write�
py_compilerQr0r�assertIsNone)rk�test_dir�	init_path�cached_path�fobjr�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)rrr0�splitdoc)rk�example_strings  r �test_splitdoc_with_descriptionz+PydocDocTest.test_splitdoc_with_description�s=��A��������7�7�C�	E�	E�	E�	E�	Erc��tj��5}|�tj|����ddd��dS#1swxYwYdSre)rr&�assertFalser0�	ispackage)rkr.s  r � test_is_package_when_not_packagez-PydocDocTest.test_is_package_when_not_package�s���
�
�
!�
!�	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__.pyr)rr&rHrIr'r�close�
assertTruer0r:�remove)rkr.r/s   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�rks r �method_returning_truezEPydocDocTest.test_allmethods.<locals>.TestClass.method_returning_true�s���trN)rrrrGrrr �	TestClassrD�s#������
�
�
�
�
rrHrGr�	__class__�__subclasshook__�__init_subclass__)	r��dict�varsrGrJrKr0�
allmethods�assertDictEqual)rkrHr��methodss    r �test_allmethodszPydocDocTest.test_allmethods�s���	�	�	�	�	��	�	�	�
��V���%�%��,5�,K��(�)��Y���[�!�(1�'A��#�$�(1�(C��$�%��"�9�-�-�����W�h�/�/�/�/�/rc����Gd�d���G�fd�d���}tj|��}tjdd|��}|�|dt
z��tj|tj�����}d	t
�d
�}t|��}d�|�d��D��}|D]}|�	||���dS)
Nc� �eZdZdd�ZeZd�ZdS)�+PydocDocTest.test_method_aliases.<locals>.ANc��dS)z(Raise this widget in the stacking order.Nr)rk�	aboveThiss  r �tkraisez3PydocDocTest.test_method_aliases.<locals>.A.tkraise�����rc��dS)zReturn sizeNrrFs r �a_sizez2PydocDocTest.test_method_aliases.<locals>.A.a_sizerXrre)rrrrW�liftrZrrr r�rT�s<������
?�
?�
?�
?��D�
"�
"�
"�
"�
"rr�c�*��eZdZdd�ZeZ�jZdS)�+PydocDocTest.test_method_aliases.<locals>.BNc��dS)z'Configure resources of an item TAGORID.Nr)rk�tagOrId�cnf�kws    r �
itemconfigurez9PydocDocTest.test_method_aliases.<locals>.B.itemconfigurerXrre)rrrrb�
itemconfigrZ�b_size)r�s�r r�r]s/�������
>�
>�
>�
>�&�J��X�F�F�Frr�rOr#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 (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
��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 (if defined)
        __weakref__
            list of weak references to the object (if defined)
c�:�g|]}|�|�����Srrr�s  r r�z4PydocDocTest.test_method_aliases.<locals>.<listcomp>Rs&��U�U�U�4�PT�U�$�*�*�,�,�U�U�Urr-)
r0r�rPrRrrrr>r`�splitr�)rkr�rBr��as_textr��
expected_liner�s       @r �test_method_aliasesz PydocDocTest.test_method_aliases�sF���	"�	"�	"�	"�	"�	"�	"�	"�	�	�	�	�	�	�	��	�	�	���q�!�!���f�U�B��$�$������%�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�	2rc��ddl}t|��\}}t|��\}}tt��\}}tt��\}}|jD]e}|�d�}d|�d�}	|�||��|�|	|��|�||��|�|	|���fdS)Nrz = _Featurez<strong>z</strong> = _Feature)�
__future__rTrEr�all_feature_namesr�r�)
rkrm�future_textrY�future_html�pydoc_mod_text�pydoc_mod_html�feature�txtr_s
          r �test__future__importsz"PydocDocTest.test__future__importsVs���	����'�
�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)&rrrr��unittest�skipIf�hasattrr�r{rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr#r3r7r;rArQrkrurrr rzrz�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��X�_�W�W�S�*�-�-�@�,�#�,�.�.�H�J�J�� *� *���J�J� *�D<�<�<�+�+�+�	8�	8�	8��-�-���-�
/�
/�
/�E�E�E�
8�8�8�!�!�!�0�0�0�2�X2�X2���X2�t3�3�3�3�3rrzc��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��dSre)rH�mkdirrr.rrr(�invalidate_cachesrFs r �setUpzPydocImportTest.setUpjs<�����(�(��
������'�'�'��#�%�%�%�%�%rc�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.{}�pyrz
import {}
)�
PYTHONPATHr�)rrHrIr'r�extseprr+r<�decode�badimport_patternrr)	rk�modname�	testpairs�sourcefn�importstring�
expectedinmsg�frur�s	         r �test_badimportzPydocImportTest.test_badimportos^��"��.�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�rzinvalid python syntax = $1
�rI�xyzzyr#)rHrIr'rr|r�rr+rorrr0�aproposrrr�r2)rk�pkgdir�	badsyntaxr�r8r9s      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#)rHrIr'r�unreadable_dirr|r�rmdirrorrr0r�rrr�)rkr8r9s   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�walkpkgr=rr%r�r#)rHrIr'rr|rrrr+�stat�S_IMODE�st_mode�chmod�S_IEXECrorr0r�r�r�)rkr�r/r1�current_moder�s      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_packager=�wtr�rzraise ValueError("ouch")
r�r�ouchzsearch?key=test_error_package�Pydoc: Search Resultsz8<a href="test_error_package.html">test_error_package</a>)rHrIr'rr|rr+ro�tupler��insert�assertRaisesRegex�
ValueErrorr�rvr�)rkr��initr��saved_pathsr�rW�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)rr0r�r�r2�lenr��assertGreaterEqual)	rk�num_header_lines�num_module_lines_min�num_footer_linesr�rCr�ru�	num_liness	         r �test_moduleszPydocImportTest.test_modules�s����� ����#�&:�:�=M�M��������V�,�,�,����y�������"�"�(�(�*�*����)�)�+�+�,�,�	����	�8�4�4�4�4�4rc��d}t��}tj|���}t��5}|d��ddd��n#1swxYwY|���}|�||��dS)Nzpydoc - r�z
modules pydoc)rr0r�rr�r��rkr�rCr�rrus      r �test_modules_searchz#PydocImportTest.test_modules_search�s�����������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)rr0r�rr�r?�
startswithr�s      r �test_modules_search_builtinz+PydocImportTest.test_modules_search_builtin�s�����������V�,�,�,��
�
�
�	&�'��F�$�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&��!�!�#�#������)�)�(�3�3�4�4�4�4�4r�c�B�tjtj��}|�|t��|�|jd��|�|jtj��|�|jtj��dS)Nr0)r0�
importfiler1�assertIsNotrrr�__spec__)rk�loaded_pydocs  r �test_importfilezPydocImportTest.test_importfile�s���'���7�7������u�-�-�-�����.��8�8�8�����.���?�?�?�����.���?�?�?�?�?rN)rrrr~r�r�r�r�skip_unless_working_chmodrvrwrr�r��skipr�r�r�r�rrr rzrzhs(������&�&�&�
/�/�/�*1�1�1�*
-�
-�
-��(��X�_�]�$9�:�:�+�+�;�:�)�(�+� *�*�*�.�X�]�=�>�>�
5�
5�?�>�
5��X�]�=�>�>�
(�
(�?�>�
(��X�]�@�A�A�	5�	5�B�A�	5�@�@�@�@�@rrzc���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
d���Ze
d	���Zd
�Z
ed���Zd�Zd
�Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zd�Zd�Z ed���Z!dS)�TestDescriptionsc�f�ddlm}tj|��}|�d|��dS)Nr)�pydocfodderr�)�testr�r0r�r�)rkr�rBs   r �test_modulezTestDescriptions.test_modules>��$�$�$�$�$�$���{�+�+���
�
�m�S�)�)�)�)�)rc�8�Gd�d��}|��}|�tj|��d��|�tj|��d��dtz}|�|tj|����dS)Nc��eZdZdZdS)�&TestDescriptions.test_class.<locals>.CzNew-style classNrrrr �Cr�s������"�"�"�"rr�zclass CzC in module %s object)rrr0�describerr�r�)rkr��cr�s    r �
test_classzTestDescriptions.test_classs���"�"�"�"�"�"�"�"�
�A�C�C��������*�*�I�6�6�6�������*�*�C�0�0�0�*�X�5���
�
�h�� 0�� 3� 3�4�4�4�4�4rc��|�tjtjt
��d��tjtjt
tj���}|�d|��|�d|��|�tj
������d|��|�tjtt
��d��tjtt
tj���}|�d|��|�d|��|�tj
������d|��dS)	N�
_GenericAliasrez_GenericAlias in module typingzList = class list(object)r�GenericAliaszGenericAlias in module builtinsz
class list(object))
rrr0r��typing�List�intr��	plaintextr��listrr2r��rkrBs  r �test_generic_aliasz#TestDescriptions.test_generic_aliassF���������C�(8�9�9�?�K�K�K���v�{�3�/�%�/�J�J�J���
�
�6��<�<�<��
�
�1�3�7�7�7��
�
�d�l�(�(�*�*�5�5�7�7��:�C�@�@�@�������S�	�2�2�N�C�C�C���t�C�y�5�?�C�C�C���
�
�7��=�=�=��
�
�,�c�2�2�2��
�
�d�l�(�(�*�*�5�5�7�7��:�C�@�@�@�@�@rc���|�tjtjt
tf��d��tjtjt
tftj���}|�	d|��|�	d|��tjj
rO|�	tjj
������d|��|�tjt
tz��d��tjt
tztj���}|�	d|��|�	d|��|�	tjj
������d|��dS)	N�_UnionGenericAliasrez#_UnionGenericAlias in module typingzUnion = typing.Unionr�	UnionTypez UnionType in module types objectz!
class UnionType(builtins.object))rrr0r�r��Unionr�r�r�r�r�rr2r��typesr�r�s  r �test_union_typez TestDescriptions.test_union_type!sc���������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�@�@�@��
�
�e�o�-�3�3�5�5�@�@�B�B�1�E�s�K�K�K�K�Krc��|�tjtj��d��tjtjtj���}|�d|��tjjrg|�d|��|�tjj�	���
��d|��dS|�d|��dS)N�_SpecialFormrez_SpecialForm in module typingzNoReturn = typing.NoReturnrz%NoReturn = class _SpecialForm(_Final))rrr0r�r��NoReturnr�r�r�rr2r�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�Grc	�X�dtjtjdtdtjtjttjffd�}tjd��}Gd�dtj|tjttf��}|�
tj|���
��dd	��|�
tj|���
��d
d��dS)N�datar��returnc��dSrer)r�r�s  r �fooz/TestDescriptions.test_typing_pydoc.<locals>.foo:s���Cr�Tc��eZdZdS)�-TestDescriptions.test_typing_pydoc.<locals>.CNr�rrr r�r�>s�������rr����z?ffoooo(data: List[Any], x: int) -> Iterator[Tuple[int, Any]]r�z2class CC(collections.abc.Mapping, typing.Generic))r�r��Anyr��Iterator�Tuple�TypeVar�Generic�Mappingr�rrr0r�r�)rkr�r�r�s    r �test_typing_pydocz"TestDescriptions.test_typing_pydoc9s��	�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�	Rrc��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)	�assertIsNotNoner0�locater��ImportError�failrr-�assertRaises)rk�names  r �test_builtinzTestDescriptions.test_builtinEs���/�	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��}t	|��dksJ�|dS�Nr-r�)r0�plainr�rhr���orW�liness   r �_get_summary_linez"TestDescriptions._get_summary_lineVsI���{�5�+�A�.�.�/�/���
�
�4� � ���5�z�z�Q������Q�x�rc��tjtj|����}|�d��}d�|dd���Sr)r0rr�rhr'r
s   r �_get_summary_linesz#TestDescriptions._get_summary_lines]sG���{�5�+�A�.�.�/�/���
�
�4� � ���y�y��q�r�r��#�#�#rc�v�|�|�tjj��d��dS)Nzwrap(self, text))rrrr��TextWrapper�wraprFs r �test_unbound_python_methodz+TestDescriptions.test_unbound_python_methodds=������/�/��0D�0I�J�J��	 �	 �	 �	 �	 rc�v�|�|�tjj��d��dS)Nzdump(self, obj, /))rrr�_pickle�Pickler�dumprFs r �test_unbound_builtin_methodz,TestDescriptions.test_unbound_builtin_methodhs<������/�/���0D�E�E� �	"�	"�	"�	"�	"rc��tj��}|�|�|j��d��dS)Nz2wrap(text) method of textwrap.TextWrapper instance)r�rrrrr)rk�ts  r �test_bound_python_methodz)TestDescriptions.test_bound_python_methodnsL��� �"�"������/�/���7�7�@�	B�	B�	B�	B�	Brc���tdgd���}tj|��}|�|�d��|�d����|�|�d��|�d����Gd�d��}Gd�d	��}tj|��tj|��dS)
Nr)rr�agegrouprrr c��eZdZdZdS)�MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonIterableFieldsN�rrr�_fieldsrrr �NonIterableFieldsr"xs�������G�G�Grr%c��eZdZggZdS)�MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonHashableFieldsNr#rrr �NonHashableFieldsr'{s�������d�G�G�Grr()rr0r��
assertLess�index)rkrr'r%r(s     r �!test_field_order_for_named_tuplesz2TestDescriptions.test_field_order_for_named_tuplesrs����H�&K�&K�&K�L�L����V�$�$��������
�+�+�Q�W�W�[�-A�-A�B�B�B��������,�,�a�g�g�j�.A�.A�B�B�B�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	��*�+�+�+�
��*�+�+�+�+�+rc��t��}tj|��}|�|�|j��d��dS)Nz/dump(obj, /) method of _pickle.Pickler instance)rrrrrrr)rkr'�ps   r �test_bound_builtin_methodz*TestDescriptions.test_bound_builtin_method�sQ���J�J���O�A��������/�/���7�7�=�	?�	?�	?�	?�	?rc�l�|�|�tj��d��dS)Nz0stat(path, *, dir_fd=None, follow_symlinks=True))rrrrHr�rFs r �test_module_level_callablez+TestDescriptions.test_module_level_callable�s>������/�/���8�8�>�	@�	@�	@�	@�	@rc�X�Gd�d��}|�|�|jd��d��|�|�|j��d��|�dtjtj|������dS)Nc�$�eZdZed���ZdS)�-TestDescriptions.test_staticmethod.<locals>.Xc��dS)zA static methodNr�r��ys  r �smz0TestDescriptions.test_staticmethod.<locals>.X.sm��	���rN)rrr�staticmethodr7rrr �Xr3�s-������
�
�
��\�
�
�
rr:r7zsm(x, y)
    A static method
zL
 |  Static methods defined here:
 |  
 |  sm(x, y)
 |      A static method
)rrr�__dict__r7r�r0rr��rkr:s  r �test_staticmethodz"TestDescriptions.test_staticmethod�s���	�	�	�	�	�	�	�	�
	
����0�0���D�1A�B�B�1�	2�	2�	2�	
����0�0���6�6�9�	�	�	�	
�
�
��
�[��!�!�$�$�%�%�	'�	'�	'�	'�	'rc�X�Gd�d��}|�|�|jd��d��|�|�|j��d��|�dtjtj|������dS)Nc�$�eZdZed���ZdS)�,TestDescriptions.test_classmethod.<locals>.Xc��dS)zA class methodNr)�clsr�s  r �cmz/TestDescriptions.test_classmethod.<locals>.X.cm�r8rN)rrr�classmethodrCrrr r:r@�s-������
�
�
��[�
�
�
rr:rCzcm(...)
    A class method
z:cm(x) method of builtins.type instance
    A class method
zZ
 |  Class methods defined here:
 |  
 |  cm(x) from builtins.type
 |      A class method
)rrrr;rCr�r0r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�	�	�	�	
�
�
��
�[��!�!�$�$�%�%�	'�	'�	'�	'�	'rc��|�|�tj��d��|�|�tj��d��|�|�tj��d��|�|�tj	��d��dS)N�	numerator�realr5�obj)
rrrr�rG�floatrHr�r5�
memoryviewrIrFs r �test_getset_descriptorz'TestDescriptions.test_getset_descriptor�s���	
����/�/��
�>�>��L�L�L�����/�/��
�;�;�V�D�D�D�����/�/�	��?�?��H�H�H�����/�/�
��?�?��G�G�G�G�Grc��|�|�tj��d��|�|�tj��d��|�|�tj��d��|�|�tj��d��|�|�tj
��d��dS)NrH�start�fget�value)rrr�complexrH�rangerN�slice�propertyrO�
StopIterationrPrFs 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�Nrc�|�Gd�d��}|�|�|j��d��dS)Nc��eZdZdZdS)�4TestDescriptions.test_slot_descriptor.<locals>.Pointr5N)rrr�	__slots__rrr �PointrY�s������ �I�I�Irr[r�)rrrr�)rkr[s  r �test_slot_descriptorz%TestDescriptions.test_slot_descriptor�sV��	!�	!�	!�	!�	!�	!�	!�	!�����/�/���8�8�#�>�>�>�>�>rc��Gd�d��}|�|�|jd��d��dS)Nc��eZdZdS)�6TestDescriptions.test_dict_attr_descriptor.<locals>.NSNr�rrr �NSr_�r�rr`r;)rrrr;)rkr`s  r �test_dict_attr_descriptorz*TestDescriptions.test_dict_attr_descriptor�sf��	�	�	�	�	�	�	�	�����/�/���J�0G�H�H�#�	%�	%�	%�	%�	%rc�.�|�|�ttj��j��d��|�|�ttj��j��d��|�|�ttj��j	��d��|�|�ttj
��j��d��dS)N�width�debug�major�max)rrrr�r��	hash_inforc�flagsrd�version_infore�
float_inforfrFs r � test_structseq_member_descriptorz1TestDescriptions.test_structseq_member_descriptor�s�������/�/��S�]�0C�0C�0I�J�J� �	"�	"�	"�����/�/��S�Y���0E�F�F� �	"�	"�	"�����/�/��S�5E�0F�0F�0L�M�M� �	"�	"�	"�����/�/��S�^�0D�0D�0H�I�I��	 �	 �	 �	 �	 rc��tdd��}|�|�|j��d��dS)N�Box)rc�heightz    Alias for field number 0
)rrrrrc)rkrms  r � test_namedtuple_field_descriptorz1TestDescriptions.test_namedtuple_field_descriptor�sK���� 3�4�4������0�0���;�;�>�	�	�	�	�	rc���Gd�d��}|�|�|j��d��|�dt	jt	j|������dS)Nc�$�eZdZed���ZdS)�,TestDescriptions.test_property.<locals>.Rectc� �|j|jzS)zArea of the rect)r�hrFs r �areaz1TestDescriptions.test_property.<locals>.Rect.area�s���v����&rN)rrrrTrurrr �Rectrr�s-������
�
'�
'��X�
'�
'�
'rrvz    Area of the rect
z#
 |  area
 |      Area of the rect
)rrrrur�r0rr�)rkrvs  r �
test_propertyzTestDescriptions.test_property�s���	'�	'�	'�	'�	'�	'�	'�	'�	
����0�0���;�;�>�	�	�	�	
�
�
���[��!�$�'�'�(�(�	*�	*�	*�	*�	*rc���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�rkrIrBs   r �__get__zGTestDescriptions.test_custom_non_data_descriptor.<locals>.Descr.__get__�����;��K��rrN)rrrr~rrr �Descrrz�s#������
�
�
�
�
rr�c�$��eZdZ���ZdS)�;TestDescriptions.test_custom_non_data_descriptor.<locals>.XN�rrr�attr�r�s�r r:r����������5�7�7�D�D�Drr:r^zH.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>�Custom descriptorz_.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>
    Custom descriptor
r�zfoo(...)
    Custom descriptor
)rrrr�rr�rkr:r�s  @r �test_custom_non_data_descriptorz0TestDescriptions.test_custom_non_data_descriptor�s7���	�	�	�	�	�	�	�	�
	�	�	�	�	�	�	�	�	�	�	
����0�0���8�8�;W�
�;W�;W�;W�	X�	X�	X�-��������0�0���8�8�;�
�;�;�;�	�	�	�
 ��������0�0���8�8�;�	�	�	�	�	rc���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|rr}s   r r~zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__get__rrc��ddzdS)Nr�rrr}s   r �__set__zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__set__s���!����rN)rrrr~r�rrr r�r�s2������
�
�
�
�
�
�
�
rr�c�$��eZdZ���ZdS)�7TestDescriptions.test_custom_data_descriptor.<locals>.XNr�r�s�r r:r�r�rr:r#r�z    Custom descriptor
r�zfoo
    Custom descriptor
)rrrr�rrr�s  @r �test_custom_data_descriptorz,TestDescriptions.test_custom_data_descriptors���	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	
����0�0���8�8�"�=�=�=�,��������0�0���8�8�;�	�	�	� ��������0�0���8�8�;�	�	�	�	�	rc�"�dtfd�}tjtj�|����}|�d|��tj���|��}|�d|��dS)Nr�c��
K�dS�Nr�r)�igns r �
coro_functionz=TestDescriptions.test_async_annotation.<locals>.coro_function.s�����1rzasync coro_functionz4async <a name="-coro_function"><strong>coro_function)r�r0rr��documentr�r>)rkr�rWr_s    r �test_async_annotationz&TestDescriptions.test_async_annotation-s���	��	�	�	�	��{�5�?�3�3�M�B�B�C�C���
�
�+�T�2�2�2��}���'�'�
�6�6���
�
�B��	�	�	�	�	rc��d�}tjtj�|����}|�d|��tj���|��}|�d|��dS)Nc�K�dWV�dSr�rrrr �an_async_generatorzLTestDescriptions.test_async_generator_annotation.<locals>.an_async_generator:s�����G�G�G�G�G�Grzasync an_async_generatorz>async <a name="-an_async_generator"><strong>an_async_generator)r0rr�r�r�r>)rkr�rWr_s    r �test_async_generator_annotationz0TestDescriptions.test_async_generator_annotation9s���	�	�	��{�5�?�3�3�4F�G�G�H�H���
�
�0�$�7�7�7��}���'�'�(:�;�;���
�
�L��	�	�	�	�	rc��d�}tj���|��}|�d|��dS)Nc��dS)za link https://localhost/Nrrrr �a_fn_with_https_linkzHTestDescriptions.test_html_for_https_links.<locals>.a_fn_with_https_linkGs���Drz3<a href="https://localhost/">https://localhost/</a>)r0r>r�r�)rkr�r_s   r �test_html_for_https_linksz*TestDescriptions.test_html_for_https_linksEsS��	�	�	��}���'�'�(<�=�=���
�
�A��	
�	
�	
�	
�	
rN)"rrrr�r�r�r�r�r�r	r9rrrrrrr+r.r0r=rErLrVr\rarkrorwr�r�r�r�r�rrr r�r�s�������*�*�*�5�5�5�A�A�A�L�L�L�H�H�H�
R�
R�
R�C�C�C�"����\���$�$��\�$� � � ��"�"���"�
B�B�B�,�,�,� �?�?���?��@�@���@��'�'���'�(�'�'���'�(�H�H���H��O�O���O��?�?���?�
�%�%���%�� � ��� ��������
*�
*���
*�������0������0
�
�
�
�
�
��	
�	
���	
�	
�	
rr�z/Socket server not available on Emscripten/WASI.c��eZdZdZd�ZdS)�PydocServerTestzTests for pydoc._start_serverc	�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)rs�content_typerWs   r �my_url_handlerz3PydocServerTest.test_server.<locals>.my_url_handler\s���36�3�3����E�D��Kr�	localhostr)�hostname�portc�>���jr����ndSre)�serving�stop)�serverthreads�r r�z-PydocServerTest.test_server.<locals>.<lambda>hs ���<�+?�I�L�%�%�'�'�'�T�rs$the URL sent was: (/test, text/html)z/tests'the URL sent was: (/test.css, text/css)z	/test.css)r0�
_start_serverrr�errorr?r�rr�rsrrr�r��urljoin�readr�r9r-�	docserver)rkr�r�s  @r �test_serverzPydocServerTest.test_serverYs����	�	�	��*�� ������
	
����+�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����,�*�+�+�+�+�+rN)rrrrr�rrr r�r�Rs+������
(�'� ,� ,� ,� ,� ,rr�c��eZdZdZd�Zd�ZdS)�PydocUrlHandlerTestzTests for pydoc._url_handlerc��tj}|�t|dd��|�t|dd��dS)Nr�r#r��foobar)r0rqr�	TypeError)rkr�s  r �test_content_type_errz)PydocUrlHandlerTest.test_content_type_errsD��������)�Q��R�0�0�0����)�Q��X�6�6�6�6�6rc��gd�}|���5|D]\}}|�||���	ddd��dS#1swxYwYdS)N))r#�Pydoc: Index of Modules)zget?key=r�)r*r�)�topicsz
Pydoc: Topics)�keywordszPydoc: Keywords)r0�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)rorv)rk�requestsrsrZs    r �test_url_requestsz%PydocUrlHandlerTest.test_url_requests�s��������
(�
(�
*�
*�	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)rrrrr�r�rrr r�r�|s8������&�&�7�7�7�
2�2�2�2�2rr�c��eZdZd�ZdS)�
TestHelperc��|�ttjj��tt
j����dSre)rr�sortedr0r�r��keyword�kwlistrFs r �
test_keywordszTestHelper.test_keywords�s@�������� 5�6�6����/�/�	1�	1�	1�	1�	1rN)rrrr�rrr r�r��s#������1�1�1�1�1rr�c���eZdZejeed��oej��d��ed�����Z	ejeed��oej��d��ed�����Z
ejeed��oej��d��ed�����Zejeed��oej��d��ed�����Zd�Z
dS)	�PydocWithMetaClassesr{r|c��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__�rkrrIs  �r r�zIPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Meta.__getattr__�s)����5�=�=�!�6��w�w�*�*�4�0�0�0r)rrrr��
__classcell__�rIs@r �Metar��s8�������
1�
1�
1�
1�
1�
1�
1�
1�
1rr�c�.�eZdZejd���ZdS)�;PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DAc��dS)N�eggsrrFs r r�z?PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DA.ham�s���vrN)rrrr��DynamicClassAttributer�rrr �DAr��s1������
�
(�
�
�)�
(�
�
�
rr���	metaclassc3�(K�|]
}|rd|zndV��dS)z	
 |      r#Nrr%s  r r(zBPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.<genexpr>�sO����.I�.I�*+�CD�.K�l�Q�.>�.>��.I�.I�.I�.I�.I�.Irr�r�)r�r��expected_data_docstringsrr0r��!expected_dynamicattribute_patternrr�r2rr)rkr�r�r�rCr�r�rus        r �test_DynamicClassAttributez/PydocWithMetaClasses.test_DynamicClassAttribute�s��	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�
����"�"�(�(�*�*�������/�/�/�/�/rc�<�Gd�dt��}Gd�d|���}t��}tj|���}||��tt
z}|������}|�||��dS)Nc�$��eZdZd�Z�fd�Z�xZS)�HPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Metac�
�gd�S)N)rIrr�LIFEr�rBs r �__dir__zPPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__dir__�s��F�F�F�Frc�V��|dkrdSt���|��S)Nr�r�)r��_Meta__getattrr�s  �r r�zTPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__getattr__�s)����&�=�=��2��w�w�(�(��.�.�.r�rrrr�r�r�r�s@r r�r��sJ�������
G�
G�
G�
/�
/�
/�
/�
/�
/�
/�
/�
/rr�c��eZdZdS)�IPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.ClassNr�rrr �Classr��r�rr�r�r�)	r�rr0r��"expected_virtualattribute_pattern1rr�r2rr)rkr�r�rCr�r�rus       r �%test_virtualClassAttributeWithOneMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithOneMeta�s���	/�	/�	/�	/�	/�4�	/�	/�	/�	�	�	�	�	�d�	�	�	�	�������V�,�,�,����u�
�
�
�:�X�E�
����"�"�(�(�*�*�������/�/�/�/�/rc��
��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)rIrrr�rr�s r r�zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__dir__����E�E�E�Erc�V��|dkrdSt���|��S)Nr�r�r�r�s  �r r�zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__getattr__��)����%�<�<��1��w�w�*�*�4�0�0�0rr�r�s@r �Meta1r���J�������
F�
F�
F�
1�
1�
1�
1�
1�
1�
1�
1�
1rr�c�$��eZdZd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2c�
�gd�S)N)rIrr�tworr�s r r�zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__dir__�r�rc�V��|dkrdSt���|��S)Nrr�r�r�s  �r r�zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__getattr__�r�rr�r�s@r �Meta2r��r�rrc�,���eZdZ��fd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3c
���tttgd���|��z��|��z������S)N)rIrr�three)r�r��setr�)rBr�rs ��r r�zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__dir__�s^����F�3�D�D�D��M�M�#�&�&�'�).���s�);�);�<�$=�$=�>�>�?�?�?rc�V��|dkrdSt���|��S)Nrr�r�r�s  �r r�zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__getattr__�s)����'�>�>��1��w�w�*�*�4�0�0�0rr�)rIr�rs@��r �Meta3r�sW��������
?�
?�
?�
?�
?�
?�
1�
1�
1�
1�
1�
1�
1�
1�
1rr	c��eZdZdS)�JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class1Nr�rrr �Class1r�r�rrr�c��eZdZdS)�JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class2Nr�rrr �Class2r�r�rrr�)
r�rr0r��"expected_virtualattribute_pattern2rr�r2rr�"expected_virtualattribute_pattern3)rkr	rrrCr��expected_text1�result1�expected_text2�result2r�rs          @@r �%test_virtualClassAttributeWithTwoMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta�s�����	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�1rc�<�Gd�dt��}Gd�d|���}t��}tj|���}||��tt
z}|������}|�||��dS)Nc��eZdZd�ZdS)�.PydocWithMetaClasses.test_buggy_dir.<locals>.Mc�
�gd�S)N)rIr�missing�hererr�s r r�z6PydocWithMetaClasses.test_buggy_dir.<locals>.M.__dir__�s��C�C�C�CrN)rrrr�rrr �Mr�s(������
D�
D�
D�
D�
Drrc��eZdZdZdS)�.PydocWithMetaClasses.test_buggy_dir.<locals>.Czpresent!N)rrrrrrr r�rs�������D�D�Drr�r�r�)	r�rr0r��!expected_missingattribute_patternrr�r2rr)rkrr�rCr�r�rus       r �test_buggy_dirz#PydocWithMetaClasses.test_buggy_dir�s���	D�	D�	D�	D�	D��	D�	D�	D�	�	�	�	�	�!�	�	�	�	�������V�,�,�,����q�	�	�	�9�H�D�
����"�"�(�(�*�*�������/�/�/�/�/rc���t��5}tjd��ddd��n#1swxYwY|���}|�d|��dS)Nz	enum.Enumz
class Enum)rr0r�r�r�)rkrrs   r �test_resolve_falsez'PydocWithMetaClasses.test_resolve_false	s����
�
�	$�'��J�{�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$��#�#�%�%���
�
�l�H�-�-�-�-�-s�0�4�4N)rrrrvrwrxr�r{rr�r�rr!r#rrr r�r��s��������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�.�.�.�.�.rr�c�:�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�argv0dirrHrIr'�argv0r�cleanup�getcwd�
abs_curdir�curdir�curdir_spellings)rk�tmpdirr.s   r r~zTestInternalUtilities.setUpso���,�.�.�����
��W�\�\�&�+�}�=�=��
������'�'�'�')�y�{�{�2���*�!#�R�Y�
� ;����rNc�>�|�|j}tj||��Sre)r+r0�_get_revised_path)rk�
given_pathr+s   r r3z'TestInternalUtilities._get_revised_paths#���=��J�E��&�z�5�9�9�9rc���tj���}|jD]<}t	|�|����D]}|�|����=|Sre)r�rI�copyr0rR�countr@)rk�
clean_path�spelling�__s    r �_get_starting_pathz(TestInternalUtilities._get_starting_path#sj���X�]�]�_�_�
��-�	,�	,�H��J�,�,�X�6�6�7�7�
,�
,���!�!�(�+�+�+�+�
,��rc��|���}|jg|z}|�|�|��|��dSre)r;r.rrr3)rkr8�
expected_paths   r �,test_sys_path_adjustment_adds_missing_curdirzBTestInternalUtilities.test_sys_path_adjustment_adds_missing_curdir+sL���,�,�.�.�
���)�J�6�
�����/�/�
�;�;�]�K�K�K�K�Krc��|���}|jg|z}|jg|z}|�|�|��|��||jgz}|�|�|��|��dSre)r;r.r*rrr3)rkr8r=�leading_argv0dir�trailing_argv0dirs     r �*test_sys_path_adjustment_removes_argv0_dirz@TestInternalUtilities.test_sys_path_adjustment_removes_argv0_dir0s����,�,�.�.�
���)�J�6�
� �M�?�Z�7������/�/�0@�A�A�=�Q�Q�Q�&�$�-��8������/�/�0A�B�B�M�R�R�R�R�Rrc����fd�}����}�jg|z}�jg|z}��||��|��|�jgz}�jg|z}��||��|��dS)Nc�F����|tj���S)N)r+)r3r0r1)r4rks �r r3z\TestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir.<locals>._get_revised_path9s����)�)�*�E�N�)�K�K�Kr)r;r*r.rr)rkr3r8r@r=rAs`     r �+test_sys_path_adjustment_protects_pydoc_dirzATestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir8s����	L�	L�	L�	L�	L��,�,�.�.�
� �M�?�Z�7����)�,<�<�
����*�*�+;�<�<�m�L�L�L�&�$�-��8����)�,=�=�
����*�*�+<�=�=�}�M�M�M�M�Mrc�"�|���}|jD]�}|�|���5|g|z}|�|�|����||gz}|�|�|����|jg|z}|�|�|����||jgz}|�|�|����ddd��n#1swxYwY��dS)N)�curdir_spelling)r;r0�subTestr-r3r*)rkr8r9�leading_curdir�trailing_curdirr@rAs       r �5test_sys_path_adjustment_when_curdir_already_includedzKTestInternalUtilities.test_sys_path_adjustment_when_curdir_already_includedCsn���,�,�.�.�
��-�
	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	re)
rrrr~r3r;r>rBrErKrrr r%r%s�������<�<�<�:�:�:�:����L�L�L�
S�S�S�	N�	N�	N�M�M�M�M�Mrr%c��tj��}tjtjg|�R�tjt
��dSre)r�threading_setuprv�addModuleCleanup�threading_cleanupr)�thread_infos r �setUpModulerQRsD��"�2�4�4�K���.�@�O�;�O�O�O�O���m�,�,�,�,�,r�__main__)ZrHr�rw�importlib.utilr(r�r0r,r�rrnrPr�r(�test.supportr�r�r�rv�urllib.parser��	xml.etreer��xml.etree.ElementTreer��ior�collectionsr�urllib.requestrrrr�test.support.script_helperr	r
rrr
rrrrr�test.support.os_helperrrrrr�support�HAVE_DOCSTRINGSr�r2r�r�r�r��expected_html_data_docstringsr,�linesepr�r�r�r�rrr r:r<rErMrTr[r`�TestCaserbrzrzr�rwr�r�r�r�r%rQr�mainrrr �<module>rcs���	�	�	�	�
�
�
�
���������������������������������	�	�	�	�����������������
�
�
�
���������������������������"�"�"�"�"�"�.�.�.�.�.�.�.�.�&�&�&�&�&�&�"�"�"�"�"�"�N�N�N�N�N�N�N�N�)�)�)�)�)�)�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�<�;�;�;�;�;�;�;�;�;�������	�	�	�	�	�	�	�	��<��0� ���
 0��\�x
�E�G�G�y�|!&��&I�&I�/G�&I�&I�&I�!I�!I��J��X!&��&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�%����<T3�T3�T3�T3�T3�8�$�T3�T3�T3�nX@�X@�X@�X@�X@�m�X@�X@�X@�vL
�L
�L
�L
�L
�x�(�L
�L
�L
�^
�����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