HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/__pycache__/test_pydoc.cpython-312.opt-2.pyc
�

~h�e�����ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZmZddlm Z ddlm!Z!ddl"m#Z#m$Z$m%Z%ddlm&Z&dd	lm'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.dd
l/m0Z0m1Z1m2Z2ddlm3Z3Gd�d
�Z4ejjjlrdZ7ndZ7djq�Z9e:d�e7D��Z;dZ<e:d�e7D��Z=dj}dej~�Z@dZAdjq�ZBdjq�ZCdjq�ZDdjq�ZEdjq�ZFd�ZGd�ZHd�ZId�ZJd �ZKd!�ZLd"�ZMGd#�d$ej��ZOGd%�d&ej��ZPGd'�d(eO�ZQGd)�d*ej��ZRej�e+xse,d+�Gd,�d-ej���ZTGd.�d/eO�ZUGd0�d1ej��ZVGd2�d3ej��ZWGd4�d5ej��ZXd6�ZYeZd7k(rej��yy)8�N)�StringIO)�
namedtuple)�urlopen�
urlcleanup)�
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_modc��eZdZ	y)�nonasciiN��__name__�
__module__�__qualname__���6/opt/alt/python312/lib64/python3.12/test/test_pydoc.pyrr%s�� �r r)�!dictionary for instance variables�%list of weak references to the objectr"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
     |
     |  __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.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|znd���y�w)z
     |      r$Nr��.0�ss  r!�	<genexpr>r)�s(����&I�*+�?@�&6��&:�R�&G�&I���aM
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
        __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) from builtins.type
    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.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#�@K�|]}|jdd����y�w)� �&nbsp;N)�replacer&s  r!r)r)�s%����&I�*+�'(�i�i��X�&>�&I�s�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�t�	||fz}tdtjg|��i|��\}}}|j�S�Nz-B)r	�pydoc�__file__�strip��module_name�args�env�rc�out�errs      r!�	run_pydocr</sA����;�.� �D�#�D�%�.�.�G�4�G�3�G�L�B��S��9�9�;�r c�t�	||fz}tdtjg|��i|��\}}}|j�Sr1)r
r2r3r4r5s      r!�run_pydoc_failr>9sA����;�.� �D�(��u�~�~�L��L��L�L�B��S��9�9�;�r c��	tj�}|j|�}|jt�xsd}|rd|zdz}|j�|fS)Nr$z
<br><a href="z">Module Docs</a>)r2�HTMLDoc�	docmodule�	getdoclocrr4)�module�doc�output�locs    r!�get_pydoc_htmlrGAsU��,�
�-�-�/�C�
�]�]�6�
"�F�

�-�-�	�
"�
(�b�C�
���$�';�;���<�<�>�3��r c���	tjj}tjj}|||t���}tj�}|j||��}|S)N)�basedir)�os�path�abspath�dirnamer3r2�TextDocrB)rCrLrMrIrDrFs      r!�get_pydoc_linkrOJsU��2��g�g�o�o�G��g�g�o�o�G��g�g�h�/�0�1�G�
�-�-�/�C�

�-�-���-�
0�C��Jr c��	tj�}|jt�xsd}|rd|zdz}|j	|�}tjd�}|jd|�}|j�|fS)Nr$z
MODULE DOCS
    r/�.)	r2rNrBrrA�re�compile�subr4)rCrDrFrE�patts     r!�get_pydoc_textrVSst��,�
�-�-�/�C�

�-�-�	�
"�
(�b�C�
�#�c�)�D�0��
�]�]�6�
"�F��:�:�e��D�
�X�X�b�&�
!�F��<�<�>�3��r c��|jd�\}}}|jd�\}}}|jd�\}}}|S)Nz</head>z<title>z</title>)�	partition)�text�header�_�titles    r!�get_html_titler]asE���>�>�)�,�L�F�A�q��"�"�9�-�K�A�q�%��/�/�*�-�K�E�1�a��Lr c	��	|jdd�}tjdd|�}tj|ddddd	d
�}|S)Nz<dd>r/z<.*?>r$r-r,z&gt;�>z&lt;�<)r.rRrTr2)�htmls r!�	html2textrbisJ����<�<���%�D�
�6�6�'�2�t�$�D��=�=��x��f�c�6�3�G�D��Kr c�@�eZdZdd�Zej
dd��Zd�Zy)�
PydocBaseTestNc�j���	|xs$tjjt�g�d��fd�	}|S)Nc� ���|xs�||�S�Nr)rK�prefix�onerror�default_path�
walk_packagess   ��r!�wrapperz8PydocBaseTest._restricted_walk_packages.<locals>.wrapper|s��� ��!5��v�w�G�Gr )Nr$N)rJrKrMr3)�selfrkrKrlrjs `  @r!�_restricted_walk_packagesz'PydocBaseTest._restricted_walk_packagesvs/���	��:������� 9�:��	H��r c#�K�tj}|j||�t_	d��|t_y#|t_wxYw�wrg)�pkgutilrkrn)rmrKrks   r!�restrict_walk_packagesz$PydocBaseTest.restrict_walk_packages�sB�����-�-�
� $� >� >�}�?C�!E���	2��$1�G�!��M�G�!�s�,A�?�A�
A�Ac�n�tj|d�}t|�}|j|||�|S)Nz	text/html)r2�_url_handlerr]�assertEqual)rm�url�expected_titlerY�results     r!�call_url_handlerzPydocBaseTest.call_url_handler�s5���!�!�#�{�3����%��������6��r rg)rrrrn�
contextlib�contextmanagerrqrxrr r!rdrdts&������2��2�r rdc� �eZdZdZej
eed�xrej�d�e	d���Z
ej
eed�xrej�d�e	d���Zd�Zd�Z
d�Zd	�Zd
�Zd�Ze	d��Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zej
eed�xrej�d�e	d���Zd�Zd�Zd�Ze	d��Z d�Z!d�Z"d�Z#d�Z$d�Z%e	d ��Z&d!�Z'y)"�PydocDocTestN�gettrace�1trace function introduces __locals__ unexpectedlyc�D�tt�\}}t|�}|j�D�cgc]}|j	���}}|D�cgc]}|s�|��	}}|d=t
j�}|D�cgc]}|s�|j	���}}|j
||�tjt�}tjj|�}|j||�|j||�|j||�ycc}wcc}wcc}w�N�)
rGrrb�
splitlinesr4�html2text_of_expectedrt�inspect�
getabsfile�urllib�parse�quote�assertIn)	rmrw�doc_loc�text_result�line�
text_lines�expected_lines�mod_file�mod_urls	         r!�
test_html_doczPydocDocTest.test_html_doc�s���)��3������'��/:�/E�/E�/G�H�t�d�j�j�l�H�
�H�'1�:�t�T�d�:�
�:��q�M�.�9�9�;��3A�J�4�T�$�*�*�,�J��J�����^�4��%�%�i�0���,�,�$�$�X�.���
�
�g�v�&��
�
�h��'��
�
�g�v�&��I��:��Ks�D�
D�D�6D�>Dc��tt�\}}t|ftzt	j
t�fzz}|j
||�yrg)rVr�expected_text_pattern�expected_text_data_docstringsr�r�rt)rmrwr��
expected_texts    r!�
test_text_doczPydocDocTest.test_text_doc�sQ��)��3����-� �
�5�6� �+�+�I�6�8�9�:�
�	
�����/r c��ddl}Gd�d|j�}tj|�}|j	d|�y)Nrc��eZdZdZdZy)�IPydocDocTest.test_text_enum_member_with_value_zero.<locals>.BinaryIntegerrr�N)rrr�zero�onerr r!�
BinaryIntegerr��s���D��Cr r�zBinaryInteger.zero)�enum�IntEnumr2�
render_docr�)rmr�r�rDs    r!�%test_text_enum_member_with_value_zeroz2PydocDocTest.test_text_enum_member_with_value_zero�s8��	�	�D�L�L�	����}�-���
�
�*�C�0r c�n�ttjj�}|j	d|�y)Nzxml.etree.elementtree)rO�xml�etree�ElementTreer�)rm�doc_links  r!�,test_mixed_case_module_names_are_lower_casedz9PydocDocTest.test_mixed_case_module_names_are_lower_cased�s%��!�#�)�)�"7�"7�8���
�
�-�x�8r c�b�ttj�\}}|j|dd�y)Nr$z'MODULE DOCS incorrectly includes a link)rVr�r�rt)rmrwr�s   r!�test_issue8225zPydocDocTest.test_issue8225�s'��(����3��������"�&O�Pr c��tj}	dt_tj�|t_y#|t_wxYwrg)�sys�stdinr2�getpager)rm�previous_stdins  r!�test_getpager_with_stdin_nonez*PydocDocTest.test_getpager_with_stdin_none�s0������	'��C�I��N�N��&�C�I���C�I�s	�=�
A
c���Gd�d�}Gd�d�}tj|��}tj|��}|j|jdd�|�y)Nc��eZdZdZy)�)PydocDocTest.test_non_str_name.<locals>.A�*Nrrr r!�Ar��s���Hr r�c��eZdZy)�)PydocDocTest.test_non_str_name.<locals>.BNrrr r!�Br�����r r�)r2r�rtr.)rmr�r��adoc�bdocs     r!�test_non_str_namezPydocDocTest.test_non_str_name�sU��	�	�	�	������$�������$��������c�3�/��6r c�j�d}tt|�d�}t|z}|j||d�y)N�test.i_am_not_here�asciiz&documentation for missing module found)�strr>�missing_patternrt�rm�missing_modulerw�expecteds    r!�
test_not_herezPydocDocTest.test_not_here�s7��-���^�N�3�W�=��"�^�3������6�4�	6r c��tdd��}tjjdd�}|j	||�y)Nztest.test_pydoc.nonasciir�)�PYTHONIOENCODING�backslashreplace)r<r�__doc__�encoder�)rmrw�encodeds   r!�test_not_asciizPydocDocTest.test_not_ascii�s6���5��P���"�"�)�)�'�3E�F���
�
�g�v�&r c��d}tt|�d�}t|j�z}|j	||�y)Nz test.i_am_not_here r�)r�r>r�r4rtr�s    r!�test_input_stripzPydocDocTest.test_input_strip�s;��/���^�N�3�W�=��"�^�%9�%9�%;�;������6�*r c���tj}|j|d�d�|j|d�d�|j|d�d�|j|d�d�y)Nz<function stripid at 0x88dcee4>z<function stripid>z <function stripid at 0x01F65390>�42z<type 'exceptions.Exception'>)r2�stripidrt)rmr�s  r!�test_stripidzPydocDocTest.test_stripid�sl���-�-������!B�C�-�	/�����!C�D�-�	/�	
�������-�����!@�A�8�	:r c��	tj�}|jt�}d}|j	||�y)Nz� |  Built-in subclasses:
 |      async_generator
 |      BaseException
 |      builtin_function_or_method
 |      bytearray
 |      ... and \d+ other subclasses)r2rN�docclass�object�assertRegex�rmrDrY�snips    r!�)test_builtin_with_more_than_four_childrenz6PydocDocTest.test_builtin_with_more_than_four_children�s;��	�(�m�m�o���|�|�F�#��8��	
����t�$r c��	tj�}|jt�}d}|j	||�y)Nzc |  Built-in subclasses:
 |      FloatingPointError
 |      OverflowError
 |      ZeroDivisionError)r2rNr��ArithmeticErrorr�r�s    r!�test_builtin_with_childz$PydocDocTest.test_builtin_with_childs9��	�$�m�m�o���|�|�O�,��,��	
�
�
�d�D�!r c��	tj�}|jt�}d}|j	||�|jd|�y)Nz^ |  Built-in subclasses:
 |      ArithmeticError
 |      AssertionError
 |      AttributeError�ZeroDivisionError)r2rNr��	Exceptionr��assertNotInr�s    r!�test_builtin_with_grandchildz)PydocDocTest.test_builtin_with_grandchild4sJ��	�*�m�m�o���|�|�I�&��)��	
�
�
�d�D�!����,�d�3r c�|�	tj�}|jt�}|j	d|�y�NzBuilt-in subclasses)r2rNr�r�r��rmrDrYs   r!�test_builtin_no_childz"PydocDocTest.test_builtin_no_childTs4��	�,�m�m�o���|�|�-�.�����.��5r c�|�	tj�}|jt�}|j	d|�yr�)r2rNr��typer�r�s   r!�test_builtin_on_metaclassesz(PydocDocTest.test_builtin_on_metaclassesps3��	�
�m�m�o���|�|�D�!�����.��5r c�.�tdzj�}td�5}|jd�\}}|j	�j�dd}|djd�|d<|j
||�ddd�y#1swYyxYw)N�abdz-chelp()sabdi����i����rzhelp> )r�r�r�communicate�decode�removeprefixrt)rm�elines�procr:r[�oliness      r!�test_fail_help_clizPydocDocTest.test_fail_help_cli{s���!�E�)�5�5�7��
�-�
(�	-�D��%�%�f�-�F�C���Z�Z�\�,�,�.�r�"�5�F��q�	�.�.�x�8�F�1�I����V�V�,�		-�	-�	-�s�AB�Bc�:�t�5}tj|��}|jd�tdz}|j||j
�j�jdtj��ddd�y#1swYyxYw)N�rEr�r/)rr2�Helper�helpr�rt�getvaluer4r.rJ�linesep)rm�buf�helperr�s    r!�test_fail_help_output_redirectz+PydocDocTest.test_fail_help_output_redirect�sv��
�Z�	Y�3��\�\��-�F��K�K���&��.�H����X�s�|�|�~�';�';�'=�'E�'E�d�B�J�J�'W�X�		Y�	Y�	Y�s�A=B�Bc��tj}d�}d|_t�}tj|��}tt�\}}d}dj�}tj|�}|tz}	|t_	td�5}
td�5}|j|�|j�j�}|	|ftzt!j"t�fzz}
|j%d|
j��|j%d|j��|j%|
|�ddd�ddd�|t_y#1swY�xYw#1swY�!xYw#|t_wxYw)Nc��d�S)Nc��|Srgr)�xs r!�<lambda>zJPydocDocTest.test_help_output_redirect.<locals>.<lambda>.<locals>.<lambda>�s��!�r rrr r!r�z8PydocDocTest.test_help_output_redirect.<locals>.<lambda>�s���r r�ztest.pydoc_modz9
        Help on module test.pydoc_mod in test:

        �stdout�stderrr$)r2r��maxDiffrr�rVr�lstrip�textwrap�dedentr�rr�r�r4r�r�r�rt)rm�getpager_old�getpager_newr�r��unusedr�rC�help_header�expected_help_patternrEr;rwr�s              r!�test_help_output_redirectz&PydocDocTest.test_help_output_redirect�s\���~�~��,������j�����S�)��(��3����!���
�F�H�	��o�o�k�2�� +�.C� C��%���
	*� ��*�

8�f� ��*�

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

8�

8�*�E�N�

8�

8��

8�

8��*�E�N�s=�	E>�E2� B*E&�
E2�E>�&E/	�+E2�2E;�7E>�>
Fc�8�tdddg�}t�5}tj|�ddd�j	�}|jd|�|jd|�|jd|�|jd|�y#1swY�bxYw)N�Person�nickname�	firstnamezAlias for field number 0zAlias for field number 1�rrr2r�r�r�)rmr�help_io�helptexts    r!�test_namedtuple_fieldsz#PydocDocTest.test_namedtuple_fields�s����H�z�;�&?�@��
�
�	�'��J�J�v��	��#�#�%���
�
�j�(�+��
�
�k�8�,��
�
�0�(�;��
�
�0�(�;�
	�	�s�B�Bc��tdddgd��}t�5}tj|�ddd�j	�}|jd|�|jd|�|jd|�y#1swY�PxYw)	N�NT�abc�defT)�rename�_1�_replace�_asdictr)rmrrrs    r!�!test_namedtuple_public_underscorez.PydocDocTest.test_namedtuple_public_underscore�st��
��u�e�n�T�
:��
�
�	�'��J�J�r�N�	��#�#�%���
�
�d�H�%��
�
�j�(�+��
�
�i��*�	�	�s�B�B	c�b�|jtt�dD]�}ttd|��5}|dk7rt	dj|�|��t	d|��t	d|��ddd�t
jti�}|j|d	���y#1swY�8xYw)
N)z
ISO-8859-1�UTF-8�w��encodingrz#coding: {})�fileu"""line 1: héz
line 2: hi"""uline 1: hé)	�
addCleanuprr�open�print�formatr2�synopsisrt)rmr�scriptr%s    r!�
test_synopsiszPydocDocTest.test_synopsis�s��������'�/�	8�H��f�c�H�5�
4���w�&��-�.�.�x�8�v�F��(�v�6��o�F�3�	
4�
�~�~�f�b�1�H����X��7�	8�
4�
4�s�<B%�%B.	c���tjd�}|jj�d}|jj
}t
j|�}|j||�y)NrJr)	r�import_fresh_moduler�r��__spec__�cachedr2r%rt)rmrJr��filenamer%s     r!�test_synopsis_sourcelessz%PydocDocTest.test_synopsis_sourceless�sV��
�
.�
.�t�
4���:�:�(�(�*�1�-���;�;�%�%���>�>�(�+������8�,r c��tj�5}tjj	|d�}t
jj|�}t|d�5}|jd�ddd�tj|�tj|i�}|j|�tj|i�}|j|�ddd�y#1swY�uxYw#1swYyxYw)Nzfoomod42.pyr�foo = 1)r�temp_cwdrJrK�join�	importlib�util�cache_from_sourcer"�write�
py_compilerSr2r%�assertIsNone)rm�test_dir�	init_path�cached_path�fobjr%�synopsis_cacheds       r!�"test_synopsis_sourceless_empty_docz/PydocDocTest.test_synopsis_sourceless_empty_doc�s���
�
�
�
!�		/�X������X�}�=�I�#�.�.�:�:�9�E�K��i��%�
&���
�
�9�%�
&����y�)��~�~�i��4�H����h�'�#�n�n�[�"�=�O����o�.�		/�		/�
&�
&��		/�		/�s%�AC3�!C'�3A+C3�'C0	�,C3�3C<c�R�d}|jtj|�d�y)Nz#I Am A Doc


Here is my description)z
I Am A Docz
Here is my description)rtr2�splitdoc)rm�example_strings  r!�test_splitdoc_with_descriptionz+PydocDocTest.test_splitdoc_with_description�s$��A���������7�C�	Er c��tj�5}|jtj|��ddd�y#1swYyxYwrg)rr0�assertFalser2�	ispackage)rmr8s  r!� test_is_package_when_not_packagez-PydocDocTest.test_is_package_when_not_package�s<��
�
�
�
!�	8�X����U�_�_�X�6�7�	8�	8�	8�s�%A�Ac�<�tj�5}tjj	|d�}t|d�j
�|jtj|��tj|�ddd�y#1swYyxYw)N�__init__.pyr)rr0rJrKr1r"�close�
assertTruer2rD�remove)rmr8r9s   r!�test_is_package_when_is_packagez,PydocDocTest.test_is_package_when_is_package�sm��
�
�
�
!�	!�X������X�}�=�I���C� �&�&�(��O�O�E�O�O�H�5�6��I�I�i� �		!�	!�	!�s�A4B�Bc��Gd�dt�}ttt��}|j|d<|d=|d=|j|d<|j
|d<t
j|�}|j||�y)Nc��eZdZd�Zy)�/PydocDocTest.test_allmethods.<locals>.TestClassc��y)NTr�rms r!�method_returning_truezEPydocDocTest.test_allmethods.<locals>.TestClass.method_returning_true�s��r N)rrrrQrr r!�	TestClassrN�s��
r rRrQr��	__class__�__subclasshook__�__init_subclass__)	r��dict�varsrQrTrUr2�
allmethods�assertDictEqual)rmrRr��methodss    r!�test_allmethodszPydocDocTest.test_allmethods�s���	��	�
��V��%��,5�,K�,K��(�)��Y���[�!�(1�'A�'A��#�$�(1�(C�(C��$�%��"�"�9�-�����W�h�/r c����Gd�d��G�fd�d��}tj|�}tjdd|�}|j	|dt
z�tj|tj���}d	t
�d
�}t|�}|jd�D�cgc]}|s�|j���}}|D]}|j||��ycc}w)Nc��eZdZdd�ZeZd�Zy)�+PydocDocTest.test_method_aliases.<locals>.ANc��yrgr)rm�	aboveThiss  r!�tkraisez3PydocDocTest.test_method_aliases.<locals>.A.tkraises��>r c��yrgrrPs r!�a_sizez2PydocDocTest.test_method_aliases.<locals>.A.a_sizes��!r rg)rrrra�liftrcrr r!r�r^
s��
?��D�
"r r�c�4��eZdZdd�ZeZW�j
Zy)�+PydocDocTest.test_method_aliases.<locals>.BNc��yrgr)rm�tagOrId�cnf�kws    r!�
itemconfigurez9PydocDocTest.test_method_aliases.<locals>.B.itemconfigures��=r rg)rrrrk�
itemconfigrc�b_size)r�s�r!r�rfs���
>�&�J��X�X�Fr r�rQr$amPython 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
r/)r2r�rRrTrtrr@rb�splitr4r�)	rmr�rDr��as_textr�r��
expected_liner�s	        @r!�test_method_aliasesz PydocDocTest.test_method_aliasess����	"�	"�	��	����q�!���f�f�U�B��$������%�J�K%�%	�N���q�5�=�=�?�;����*���
�:�C�.��3@�3F�3F�t�3L�U�4�PT�$�*�*�,�U��U�+�	2�M��M�M�-��1�	2��Vs�/C%�7C%c�T�ddl}t|�\}}t|�\}}tt�\}}tt�\}}|jD]U}|�d�}d|�d�}	|j||�|j|	|�|j
||�|j
|	|��Wy)Nrz = _Featurez<strong>z</strong> = _Feature)�
__future__rVrGr�all_feature_namesr�r�)
rmru�future_textr[�future_html�pydoc_mod_text�pydoc_mod_html�feature�txtras
          r!�test__future__importsz"PydocDocTest.test__future__importsfs���	�'�
�3���Q�'�
�3���Q�*�9�5����*�9�5����!�3�3�	3�G��I�[�)�C��g�Y�&:�;�D��M�M�#�{�+��M�M�$��,����S�.�1����T�>�2�
	3r )(rrrr�unittest�skipIf�hasattrr�r}rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	rrr'r-r=rArErKr[rsr}rr r!r|r|�s����G��X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��
'��J�
'��X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��0��J�0�1�9�
Q�
'�
7�6��'��'�
+�:�%�>"�64�@6�8	6�-�Y��X�_�_�W�S�*�-�@�,�#�,�,�.�H�J�� *��J� *�D<�+�	8��-��-�
/�E�
8�!�0�2�X2��X2�t3r r|c��eZdZd�Zd�Zd�Zd�Zeje	jed�d���Zd�Z
e	jd�d	��Ze	jd�d
��Ze	jd�d��Zd
�Zy)�PydocImportTestc��tjt�|_|j	t
t�t
j�yrg)rJ�mkdirrr8r!rr2�invalidate_cachesrPs r!�setUpzPydocImportTest.setUpzs,������(��
������'��#�#�%r c��d}ddddj|�dfdj|�dj|�ff}tjjt|�tj
zdz}|D]w\}}t
|d	�5}|jd
j|��ddd�t|t��jd�}t||fz}|j||��yy#1swY�IxYw)
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�)r$rJrKr1r�extsepr"r5r>r��badimport_patternrt)	rm�modname�	testpairs�sourcefn�importstring�
expectedinmsg�frwr�s	         r!�test_badimportzPydocImportTest.test_badimports���"��.�F�E�
�
&�
&�w�
/��A�
�
�
�g�
&�	�(8�(8��(A�B��	��7�7�<�<���0�2�9�9�<�t�C��+4�	/�'�L�-��h��$�
<�����
�,�,�\�:�;�
<�#�G��?�F�F�w�O�F�(�G�]�+C�C�H����X�v�.�	/�
<�
<�s�!C0�0C9	c��tjjtd�}tj|�tjj|d�tj
zdz}t
|d�5}|jd�ddd�|jtg��5t�5}t�5}tjd�ddd�ddd�|jj�d�|jj�d�t�5}t�5}tjd�ddd�ddd�|j|j�j�d�|j|j�d�ddd�y#1swY��/xYw#1swY��xYw#1swY��xYw#1swY��xYw#1swY��xYw#1swYyxYw)	N�	syntaxerr�__init__r�rzinvalid python syntax = $1
�rK�xyzzyr$)rJrKr1rr�r�r"r5rqrrr2�aproposrtr�r4)rm�pkgdir�	badsyntaxr�r:r;s      r!�test_apropos_with_bad_packagez-PydocImportTest.test_apropos_with_bad_package�s��������f�k�2��
������G�G�L�L���4�r�y�y�@�4�G�	�
�)�S�
!�	4�Q�
�G�G�2�3�	4�
�
(�
(�v�h�
(�
7�	1� �"�
+�c�$�&�+�#��M�M�'�*�+�
+�
���S�\�\�^�R�0����S�\�\�^�R�0� �"�
/�c�$�&�/�#��M�M�+�.�/�
/�
���S�\�\�^�1�1�3�[�A����S�\�\�^�R�0�	1�	1�	4�	4��+�+��
+�
+��/�/��
/�
/��	1�	1�sz�:F9�+G6�6G�G�G�AG6�1G*�<G�G*�AG6�9G�G�G�G	�G6�G'�#G*�*G3	�/G6�6G?c�h�tjjtd�|_tj
|jd�|j
tj|j�|jtg��5t�5}t�5}tjd�ddd�ddd�ddd�|jj�d�|jj�d�y#1swY�ZxYw#1swY�^xYw#1swY�bxYw)N�
unreadablerr��SOMEKEYr$)rJrKr1r�unreadable_dirr�r!�rmdirrqrrr2r�rtr�)rmr:r;s   r!� test_apropos_with_unreadable_dirz0PydocImportTest.test_apropos_with_unreadable_dir�s��� �g�g�l�l�6�<�@���
����$�$�a�(�������$�"5�"5�6��
(�
(�v�h�
(�
7�	-� �"�
-�c�$�&�-�#��M�M�)�,�-�
-�	-�
	
��������,���������,�	-�-��
-�
-��	-�	-�s<�D(�D�!D�7D�?D(�D�D�D%	�!D(�(D1zcannot remove x bitc�^�tjjtd�}tj|�|jt|�tjj|d�}t|d�5}|jd�ddd�tjtj|�j�}	tj||tjz�|jtg��5t�5}t!j"d�ddd�ddd�|j%dj'��tj||�y#1swY��xYw#1swY�TxYw#1swY�XxYw#tj||�wxYw)N�walkpkgrGrr/r�r$)rJrKr1rr�r!rr"r5�stat�S_IMODE�st_mode�chmod�S_IEXECrqrr2r�r�r�)rmr�r9r;�current_moder�s      r!�test_apropos_empty_docz&PydocImportTest.test_apropos_empty_doc�s2�������f�i�0��
����������'��G�G�L�L���7�	�
�)�S�
!�	"�T��J�J�y�!�	"��|�|�B�G�G�F�O�$;�$;�<��	+��H�H�V�\�T�\�\�M�9�:��,�,�6�(�,�;�
"�_�=N�
"�RX��
�
�b�!�
"�
"��M�M�)�V�_�_�%6�7��H�H�V�\�*�	"�	"��

"�
"��
"�
"��
�H�H�V�\�*�sH�<E0�	?F�F�E<�)F�1(F�0E9�<F	�F�F�
F�F,c���tjjtd�}tj|�tjj|d�}t|dd��5}|j
d�ddd�|jtg��5ttj�}tjjdt�	|jtd	�5ddl
}ddd�|jd
d�}d}|j||�|tjdd	ddd�y#1swY��xYw#1swY�XxYw#|tjddwxYw#1swYyxYw)
N�test_error_packagerG�wtr�rzraise ValueError("ouch")
r�r�ouchzsearch?key=test_error_package�Pydoc: Search Resultsz8<a href="test_error_package.html">test_error_package</a>)rJrKr1rr�r"r5rq�tupler��insert�assertRaisesRegex�
ValueErrorr�rxr�)rmr��initr��saved_pathsr�rY�founds        r!�test_url_search_package_errorz-PydocImportTest.test_url_search_package_error�s*�������f�&:�;��
������w�w�|�|�F�M�2��
�$��w�
/�	6�1�
�G�G�4�5�	6�
�
(�
(�v�h�
(�
7�	*�����/�K��H�H�O�O�A�v�&�

*��+�+�J��?�.�-�.��,�,�-L�+�-��-���
�
�e�T�*�)������	*�	*�	6�	6��.�.��*�������	*�	*�sH�(D>�>E.�E�.E
�3.E�!E.�>E�
E	�E�E+�+E.�.E7z(causes undesirable side-effects (#20128)c��d}d}d}||z|z}t�}tj|��}|d�|j�j	�}t|j
��}|j||�y)N���r��modules)rr2r�r�r4�lenr��assertGreaterEqual)	rm�num_header_lines�num_module_lines_min�num_footer_linesr�rEr�rw�	num_liness	         r!�test_moduleszPydocImportTest.test_modules�s|���� ����#�&:�:�=M�M��������V�,���y�����"�(�(�*����)�)�+�,�	����	�8�4r c���d}t�}tj|��}t�5}|d�ddd�j	�}|j||�y#1swY�,xYw)Nzpydoc - r�z
modules pydoc)rr2r�rr�r��rmr�rEr�rrws      r!�test_modules_searchz#PydocImportTest.test_modules_search�s_����������V�,��
�
�	$�'��?�#�	$��!�!�#���
�
�h��'�		$�	$�s�	A!�!A*z+some buildbots are not cooperating (#20128)c��d}t�}tj|��}t�5}|d�ddd�j	�}|j|j
|��y#1swY�:xYw)Nzgc - r�zmodules garbage)rr2r�rr�rI�
startswithr�s      r!�test_modules_search_builtinz+PydocImportTest.test_modules_search_builtin�sg����������V�,��
�
�	&�'��$�%�	&��!�!�#������)�)�(�3�4�		&�	&�s�	A/�/A8c�V�tjtj�}|j|t�|j	|j
d�|j	|jtj�|j	|jtj�y)Nr2)r2�
importfiler3�assertIsNotrtrr*)rm�loaded_pydocs  r!�test_importfilezPydocImportTest.test_importfile
sp���'�'����7������u�-�����.�.��8�����.�.����?�����.�.����?r N)rrrr�r�r�r�r�skip_unless_working_chmodr~rrr�r��skipr�r�r�r�rr r!r�r�xs���&�
/�*1�*
-��(�(��X�_�_�]�$9�:�+�;�)�+� *�.�X�]�]�=�>�
5�?�
5��X�]�]�=�>�
(�?�
(��X�]�]�@�A�	5�B�	5�@r r�c�d�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!y)�TestDescriptionsc�^�ddlm}tj|�}|j	d|�y)Nr)�pydocfodderr�)�testr�r2r�r�)rmr�rDs   r!�test_modulezTestDescriptions.test_modules#��$����{�+���
�
�m�S�)r c��Gd�d�}|�}|jtj|�d�|jtj|�d�dtz}|j	|tj
|��y)Nc��eZdZy)�&TestDescriptions.test_class.<locals>.CNrrr r!�Cr���r r�zclass CzC in module %s object)rtr2�describerr�r�)rmr��cr�s    r!�
test_classzTestDescriptions.test_classsd��"�"�
�C���������*�I�6��������*�C�0�*�X�5���
�
�h�� 0� 0�� 3�4r c�R�|jtjtjt
�d�tjtjt
tj��}|jd|�|jd|�ts?|jtjj�j�d|�|jtjtt
�d�tjtt
tj��}|jd|�|jd|�ts@|jtjj�j�d|�yy)	N�
_GenericAliasrnz_GenericAlias in module typingzList = class list(object)r�GenericAliaszGenericAlias in module builtinsz
class list(object))rtr2r��typing�List�intr��	plaintextr�r�listr�r4r��rmrDs  r!�test_generic_aliasz#TestDescriptions.test_generic_alias$s�����������C�(8�9�?�K����v�{�{�3�/�%�/�/�J���
�
�6��<��
�
�1�3�7�#��M�M�$�,�,�,�,�.�9�9�;�A�>��D��������S�	�2�N�C����t�C�y�5�?�?�C���
�
�7��=��
�
�,�c�2�#��M�M�$�,�,�,�,�.�9�9�;�A�>��D�$r c��|jtjtjt
tf�d�tjtjt
tftj��}|jd|�|jd|�tjjrI|jtjjj�j�d|�|jtjt
tz�d�tjt
tztj��}|jd|�|jd|�tsJ|jtjjj�j�d|�yy)	N�_UnionGenericAliasrnz#_UnionGenericAlias in module typingzUnion = typing.Unionr�	UnionTypez UnionType in module types objectz!
class UnionType(builtins.object))rtr2r�r��Unionr�r�r�r�r�r�r4r�r�typesr�r�s  r!�test_union_typez TestDescriptions.test_union_type3s2�����������S�#�X�(>�?�AU�V����v�|�|�C��H�5����P���
�
�;�S�A��
�
�,�c�2��<�<����M�M�&�,�,�.�.�4�4�6�A�A�C�A�F��L��������c�	�2�K�@����s�S�y�5�?�?�C���
�
�8�#�>��
�
�:�C�@�#��M�M�%�/�/�1�1�7�7�9�D�D�F�q�I�3�O�$r c��|jtjtj�d�tj
tjtj��}|jd|�tjjr\|jd|�|jtjjj�j�d|�y|jd|�y)N�_SpecialFormrnz_SpecialForm in module typingzNoReturn = typing.NoReturnrz%NoReturn = class _SpecialForm(_Final))rtr2r�r��NoReturnr�r�r�r�r4r�r�s  r!�test_special_formz"TestDescriptions.test_special_formBs������������8�.�I����v������I���
�
�5�s�;��?�?�"�"��M�M�6��<��M�M�&�/�/�1�1�7�7�9�D�D�F�q�I�3�O��M�M�A�3�Gr c	�<�dtjtjdtdtjtj
ttjffd�}tjd�}Gd�dtj|tjttf�}|jtj|�j�dd	�|jtj|�j�d
d�y)N�datar��returnc��yrgr)r�r�s  r!�fooz/TestDescriptions.test_typing_pydoc.<locals>.fooMs��r �Tc��eZdZy)�-TestDescriptions.test_typing_pydoc.<locals>.CNrrr r!r�r�Qr�r r����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�rtr2r�r�)rmr�r�r�s    r!�test_typing_pydocz"TestDescriptions.test_typing_pydocLs���	�f�k�k�&�*�*�-�	��	�!�?�?�6�<�<��V�Z�Z��+H�I�	�
�N�N�3���A����q�!�6�>�>�#�s�(�#;�A�����)�)�#�.�9�9�;�B�?�9�	:�	
����)�)�!�,�7�7�9�!�<�P�	Rr c��dD]<}|jtj|��	tj|��>dD]K}|jtj|��|jttj|��My#t$r#|jdj
|��Y��wxYw)N)r�z
str.translatezbuiltins.strzbuiltins.str.translatezfinding the doc of {!r} failed)�notbuiltins�strrrzstrr.translatezstr.trrrranslatezbuiltins.strrrzbuiltins.str.trrranslate)	�assertIsNotNoner2�locater��ImportError�failr$r7�assertRaises)rm�names  r!�test_builtinzTestDescriptions.test_builtinXs���/�	I�D�
� � ����d�!3�4�
I�� � ��&�
	I�1�	C�D�
���e�l�l�4�0�1����k�5�+;�+;�T�B�		C���
I��	�	�:�A�A�$�G�H�
I�s�B�)B?�>B?c�~�tjtj|��}|jd�}|dS�Nr/r�)r2�plainr�rp��orY�liness   r!�_get_summary_linez"TestDescriptions._get_summary_lineis2���{�{�5�+�+�A�.�/���
�
�4� ���Q�x�r c��tjtj|��}|jd�}dj	|dd�Sr)r2rr�rpr1rs   r!�_get_summary_linesz#TestDescriptions._get_summary_linesps>���{�{�5�+�+�A�.�/���
�
�4� ���y�y��q�r��#�#r c�v�|j|jtjj�d�y)Nzwrap(self, text))rtrr�TextWrapper�wraprPs r!�test_unbound_python_methodz+TestDescriptions.test_unbound_python_methodws,������/�/��0D�0D�0I�0I�J��	 r c�v�|j|jtjj�d�y)Nzdump(self, obj, /))rtr�_pickle�Pickler�dumprPs r!�test_unbound_builtin_methodz,TestDescriptions.test_unbound_builtin_method{s*������/�/����0D�0D�E� �	"r c��tj�}|j|j|j�d�y)Nz2wrap(text) method of textwrap.TextWrapper instance)rrrtrr)rm�ts  r!�test_bound_python_methodz)TestDescriptions.test_bound_python_method�s3��� � �"������/�/����7�@�	Br c��tdgd��}tj|�}|j|j	d�|j	d��|j|j	d�|j	d��Gd�d�}Gd�d	�}tj|�tj|�y)
Nr)rr
�agegrouprr
r&c��eZdZdZy)�MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonIterableFieldsN�rrr�_fieldsrr r!�NonIterableFieldsr(�s���Gr r+c��eZdZggZy)�MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonHashableFieldsNr)rr r!�NonHashableFieldsr-�s	���d�Gr r.)rr2r��
assertLess�index)rmrr(r+r.s     r!�!test_field_order_for_named_tuplesz2TestDescriptions.test_field_order_for_named_tuples�s����H�&K�L�����V�$��������
�+�Q�W�W�[�-A�B��������,�a�g�g�j�.A�B�	�	�	�	�	���*�+�
���*�+r c��t�}tj|�}|j|j	|j
�d�y)Nz/dump(obj, /) method of _pickle.Pickler instance)rrrrtrr )rmr(�ps   r!�test_bound_builtin_methodz*TestDescriptions.test_bound_builtin_method�s9���J���O�O�A�������/�/����7�=�	?r c�b�|j|jtj�d�y)Nz0stat(path, *, dir_fd=None, follow_symlinks=True))rtrrJr�rPs r!�test_module_level_callablez+TestDescriptions.test_module_level_callable�s%������/�/����8�>�	@r c�:�Gd�d�}|j|j|jd�d�|j|j|j�d�|j	dtjtj|���y)Nc��eZdZed��Zy)�-TestDescriptions.test_staticmethod.<locals>.Xc��	yrgr�r��ys  r!�smz0TestDescriptions.test_staticmethod.<locals>.X.sm�s��%�r N)rrr�staticmethodr=rr r!�Xr9�s��
�
��
r r?r=zsm(x, y)
    A static method
zJ
 |  Static methods defined here:
 |
 |  sm(x, y)
 |      A static method
)rtr�__dict__r=r�r2rr��rmr?s  r!�test_staticmethodz"TestDescriptions.test_staticmethod�s���	�	�
	
����0�0����D�1A�B�1�	2�	
����0�0����6�9�	�	
�
�
��
�[�[��!�!�!�$�%�	'r c�:�Gd�d�}|j|j|jd�d�|j|j|j�d�|j	dtjtj|���y)Nc��eZdZed��Zy)�,TestDescriptions.test_classmethod.<locals>.Xc��	yrgr)�clsr�s  r!�cmz/TestDescriptions.test_classmethod.<locals>.X.cm�s��$�r N)rrr�classmethodrHrr r!r?rE�s��
�
��
r r?rHzcm(...)
    A class method
z:cm(x) method of builtins.type instance
    A class method
zX
 |  Class methods defined here:
 |
 |  cm(x) from builtins.type
 |      A class method
)rtrr@rHr�r2rr�rAs  r!�test_classmethodz!TestDescriptions.test_classmethod�s���	�	�
	
����0�0����D�1A�B�0�	1�	
����0�0����6�9�	�	
�
�
��
�[�[��!�!�!�$�%�	'r c�|�|j|jtj�d�|j|jtj
�d�|j|jtj�d�|j|jtj�d�y)N�	numerator�realr7�obj)
rtrr�rL�floatrMr�r7�
memoryviewrNrPs r!�test_getset_descriptorz'TestDescriptions.test_getset_descriptor�s���	
����/�/��
�
�>��L�����/�/��
�
�;�V�D�����/�/�	���?��H�����/�/�
���?��Gr c���|j|jtj�d�|j|jtj
�d�|j|jtj
�d�|j|jtj�d�|j|jtj�d�y)NrM�start�fget�value)rtr�complexrM�rangerS�slice�propertyrT�
StopIterationrUrPs r!�test_member_descriptorz'TestDescriptions.test_member_descriptor�s���	
����/�/����=�v�F�����/�/����<�g�F�����/�/����<�g�F�����/�/��
�
�>��G�����/�/�
�0C�0C�D�g�Nr c�n�Gd�d�}|j|j|j�d�y)Nc��eZdZdZy)�4TestDescriptions.test_slot_descriptor.<locals>.Pointr;N)rrr�	__slots__rr r!�Pointr^�s�� �Ir r`r�)rtrr�)rmr`s  r!�test_slot_descriptorz%TestDescriptions.test_slot_descriptor�s+��	!�	!�����/�/����8�#�>r c�t�Gd�d�}|j|j|jd�d�y)Nc��eZdZy)�6TestDescriptions.test_dict_attr_descriptor.<locals>.NSNrrr r!�NSrd�r�r rer@)rtrr@)rmres  r!�test_dict_attr_descriptorz*TestDescriptions.test_dict_attr_descriptor�s3��	�	�����/�/����J�0G�H�#�	%r c��|j|jttj�j
�d�|j|jttj�j�d�|j|jttj�j�d�|j|jttj�j�d�y)N�width�debug�major�max)rtrr�r��	hash_inforh�flagsri�version_inforj�
float_inforkrPs r!� test_structseq_member_descriptorz1TestDescriptions.test_structseq_member_descriptor�s�������/�/��S�]�]�0C�0I�0I�J� �	"�����/�/��S�Y�Y��0E�0E�F� �	"�����/�/��S�5E�5E�0F�0L�0L�M� �	"�����/�/��S�^�^�0D�0H�0H�I��	 r c�r�tdd�}|j|j|j�d�y)N�Box)rh�heightz    Alias for field number 0
)rrtrrh)rmrrs  r!� test_namedtuple_field_descriptorz1TestDescriptions.test_namedtuple_field_descriptor�s3���� 3�4������0�0����;�>�	r c���Gd�d�}|j|j|j�d�|jdt	j
t	j|���y)Nc��eZdZed��Zy)�,TestDescriptions.test_property.<locals>.Rectc�6�	|j|jzSrg)r�hrPs r!�areaz1TestDescriptions.test_property.<locals>.Rect.areas��&��v�v�����&r N)rrrrYrzrr r!�Rectrws��
�
'��
'r r{z    Area of the rect
z#
 |  area
 |      Area of the rect
)rtrrzr�r2rr�)rmr{s  r!�
test_propertyzTestDescriptions.test_property�s^��	'�	'�	
����0�0����;�>�	�	
�
�
���[�[��!�!�$�'�(�	*r c���Gd�d��G�fd�d�}|j|j|j�dt�d��d|j_|j|j|j�dt�d��d	|j_|j|j|j�d
�y)Nc��eZdZd�Zy)�?TestDescriptions.test_custom_non_data_descriptor.<locals>.Descrc��|�|Sy�Nr�r�rmrNrGs   r!�__get__zGTestDescriptions.test_custom_non_data_descriptor.<locals>.Descr.__get__����;��K�r N)rrrr�rr r!�Descrrs��
r r�c���eZdZW��Zy)�;TestDescriptions.test_custom_non_data_descriptor.<locals>.XN�rrr�attr�r�s�r!r?r��
����7�Dr r?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
)rtrr�rr��rmr?r�s  @r!�test_custom_non_data_descriptorz0TestDescriptions.test_custom_non_data_descriptors����	�	�
	�	�	
����0�0����8�?�
��S�;W�	X�-���������0�0����8�?�
���;�	�
 ���������0�0����8�;�	r c�x��Gd�d��G�fd�d�}|j|j|j�d�d|j_|j|j|j�d�d|j_|j|j|j�d	�y)
Nc��eZdZd�Zd�Zy)�;TestDescriptions.test_custom_data_descriptor.<locals>.Descrc��|�|Syr�rr�s   r!r�zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__get__*r�r c��ddzy)Nr�rrr�s   r!�__set__zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__set__.s	���!�r N)rrrr�r�rr r!r�r�)s��
�
r r�c���eZdZW��Zy)�7TestDescriptions.test_custom_data_descriptor.<locals>.XNr�r�s�r!r?r�0r�r r?r$r�z    Custom descriptor
r�zfoo
    Custom descriptor
)rtrr�r�rr�s  @r!�test_custom_data_descriptorz,TestDescriptions.test_custom_data_descriptor's����	�	�	�	�	
����0�0����8�"�=�,���������0�0����8�;�	� ���������0�0����8�;�	r c�
�dtfd�}tjtjj	|��}|jd|�tj�j	|�}|jd|�y)Nr�c��K�y�wr�r)�igns r!�
coro_functionz=TestDescriptions.test_async_annotation.<locals>.coro_functionAs	�����s�zasync coro_functionz4async <a name="-coro_function"><strong>coro_function)r�r2rr��documentr�r@)rmr�rYras    r!�test_async_annotationz&TestDescriptions.test_async_annotation@sd��	��	��{�{�5�?�?�3�3�M�B�C���
�
�+�T�2��}�}��'�'�
�6���
�
�B��	r c��d�}tjtjj|��}|j	d|�tj
�j|�}|j	d|�y)Nc�K�d���y�wr�rrr r!�an_async_generatorzLTestDescriptions.test_async_generator_annotation.<locals>.an_async_generatorMs�����G�s�	zasync an_async_generatorz>async <a name="-an_async_generator"><strong>an_async_generator)r2rr�r�r�r@)rmr�rYras    r!�test_async_generator_annotationz0TestDescriptions.test_async_generator_annotationLs_��	��{�{�5�?�?�3�3�4F�G�H���
�
�0�$�7��}�}��'�'�(:�;���
�
�L��	r c�t�d�}tj�j|�}|jd|�y)Nc��	yrgrrr r!�a_fn_with_https_linkzHTestDescriptions.test_html_for_https_links.<locals>.a_fn_with_https_linkZs��+�r z3<a href="https://localhost/">https://localhost/</a>)r2r@r�r�)rmr�ras   r!�test_html_for_https_linksz*TestDescriptions.test_html_for_https_linksXs2��	��}�}��'�'�(<�=���
�
�A��	
r N)"rrrr�r�r�r�r�rrr>rrrrr!r$r1r4r6rBrJrQr[rarfrprtr|r�r�r�r�r�rr r!r�r�s���*�5�
E�
P�H�
R�C�"�����$��$� ��"��"�
B�,� �?��?��@��@��'��'�(�'��'�(�H��H��O��O��?��?�
�%��%�� �� ������
*��
*�����0����0
�
��	
��	
r r�z/Socket server not available on Emscripten/WASI.c��eZdZ	d�Zy)�PydocServerTestc	�:��d�}tj|dd���|j�jd�|j	�j
�|j
�fd��|jd�j�|j
t�|jdttjj�jd��j��|jdttjj�jd	��j���j�|j!�j
�|j#�j$�|j#�j�y)
Nc��d|�d|�d�}|S)Nzthe URL sent was: (z, �)r)ru�content_typerYs   r!�my_url_handlerz3PydocServerTest.test_server.<locals>.my_url_handleros��36��E�D��Kr �	localhostr)�hostname�portc�@���jr�j�SdSrg)�serving�stop)�serverthreads�r!r�z-PydocServerTest.test_server.<locals>.<lambda>{s���<�+?�+?�L�%�%�'��T�r s$the URL sent was: (/test, text/html)z/tests'the URL sent was: (/test.css, text/css)z	/test.css)r2�
_start_serverrt�errorrIr�r!r�rurrr�r��urljoin�readr�rCr7�	docserver)rmr�r�s  @r!�test_serverzPydocServerTest.test_serverls<���	��*�*�� ����
	
����+�+�T�2�����,�,�-����I�	�	
�
�
�k�<�#3�#3�4����
�#����3��F�L�L�(�(��)9�)9�7�C�D�I�I�K�	�	
���6��F�L�L�(�(��)9�)9�;�G�H�M�M�O�	�
	��������-�-�.����,�0�0�1����,�*�*�+r N)rrrr�rr r!r�r�es��
(� ,r r�c��eZdZ	d�Zd�Zy)�PydocUrlHandlerTestc��tj}|jt|dd�|jt|dd�y)Nr�r$r��foobar)r2rsr
�	TypeError)rmr�s  r!�test_content_type_errz)PydocUrlHandlerTest.test_content_type_err�s5���������)�Q��R�0����)�Q��X�6r c��gd�}|j�5|D]\}}|j||��	ddd�y#1swYyxYw)N))r$�Pydoc: Index of Modules)zget?key=r�)r0r�)�topicsz
Pydoc: Topics)�keywordszPydoc: Keywords)r2�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)rqrx)rm�requestsrur\s    r!�test_url_requestsz%PydocUrlHandlerTest.test_url_requests�sO�����
(�
(�
*�	2�&�
2�
��U��%�%�c�5�1�
2�	2�	2�	2�s	�<�AN)rrrr�r�rr r!r�r��s��&�7�
2r r�c��eZdZd�Zy)�
TestHelperc��|jttjj�tt
j��yrg)rt�sortedr2r�r��keyword�kwlistrPs r!�
test_keywordszTestHelper.test_keywords�s-��������� 5� 5�6�����/�	1r N)rrrr�rr r!r�r��s��1r r�c���eZdZejeed�xrej�d�ed���Z	ejeed�xrej�d�ed���Z
ejeed�xrej�d�ed���Zejeed�xrej�d�ed���Zd�Z
y)	�PydocWithMetaClassesr}r~c�>�Gd�dt�}Gd�d|��}td�tD��}t�}t	j
|��}||�ttf|ddzz}|j�j�}|j||�y)	Nc���eZdZ�fd�Z�xZS)�=PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Metac�.��|dk(ryt�|�|�S)N�ham�spam��super�__getattr__�rmrrSs  �r!r�zIPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Meta.__getattr__�s����5�=�!��w�*�4�0�0r )rrrr��
__classcell__�rSs@r!�Metar��s
���
1�
1r r�c�0�eZdZejd��Zy)�;PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DAc��y)N�eggsrrPs r!r�z?PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DA.ham�s��r N)rrrr��DynamicClassAttributer�rr r!�DAr��s��
�
(�
(�
�)�
r r���	metaclassc3�.K�|]
}|rd|znd���y�w)z	
 |      r$Nrr&s  r!r)zBPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.<genexpr>�s(����.I�*+�CD�l�Q�.>��.K�.I�r*r�r�)r�r��expected_data_docstringsrr2r��!expected_dynamicattribute_patternrr�r4rt)rmr�r�r�rEr�r�rws        r!�test_DynamicClassAttributez/PydocWithMetaClasses.test_DynamicClassAttribute�s���	1�4�	1�
	�4�	�).�.I�/G�.I�)I�%�������V�,���r�
�9���;�B�Q�?�?�A�
����"�(�(�*�������/r c��Gd�dt�}Gd�d|��}t�}tj|��}||�tt
z}|j
�j�}|j||�y)Nc�$��eZdZd�Z�fd�Z�xZS)�HPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Metac�
�gd�S)N)rSrr�LIFEr�rGs r!�__dir__zPPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__dir__�s��F�Fr c�.��|dk(ryt�|�|�S)Nr�r�)r��_Meta__getattrr�s  �r!r�zTPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__getattr__�s����&�=���w�(��.�.r �rrrr�r�r�r�s@r!r�r��s���
G�
/�
/r r�c��eZdZy)�IPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.ClassNrrr r!�Classr��r�r r�r�r�)	r�rr2r��"expected_virtualattribute_pattern1rr�r4rt)rmr�r�rEr�r�rws       r!�%test_virtualClassAttributeWithOneMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithOneMeta�se��	/�4�	/�	�d�	�������V�,���u�
�:�X�E�
����"�(�(�*�������/r c�(�
��Gd�dt��
Gd�dt��G�
�fd�d�
��}Gd�d�
�	�}Gd
�d||�	�}t�}tj|��}||�tt
z}|j
�j�}|j||�t�}tj|��}||�tt
z}|j
�j�}	|j||	�y)
Nc�$��eZdZd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1c�
�gd�S)N)rSrrr�rr�s r!r�zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__dir__����E�Er c�.��|dk(ryt�|�|�S)Nr�r�r�r�s  �r!r�zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__getattr__������%�<���w�*�4�0�0r r�r�s@r!�Meta1r������
F�
1�
1r r�c�$��eZdZd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2c�
�gd�S)N)rSrr�tworr�s r!r�zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__dir__�r�r c�.��|dk(ryt�|�|�S)Nrr�r�r�s  �r!r�zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__getattr__�r�r r�r�s@r!�Meta2r�rr rc�,���eZdZ��fd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3c
���tttgd��j|�z�j|�z���S)N)rSrr�three)r�r��setr�)rGr�rs ��r!r�zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__dir__�sC����F�3�D��M�M�#�&�'�).���s�);�<�$=�>�?�?r c�.��|dk(ryt�|�|�S)Nr
r�r�r�s  �r!r�zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__getattr__�s����'�>���w�*�4�0�0r r�)rSr�rs@��r!�Meta3r�s���
?�
1�
1r r
c��eZdZy)�JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class1Nrrr r!�Class1r�r�r rr�c��eZdZy)�JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class2Nrrr r!�Class2r�r�r rr�)
r�rr2r��"expected_virtualattribute_pattern2rr�r4rt�"expected_virtualattribute_pattern3)rmr
rrrEr��expected_text1�result1�expected_text2�result2r�rs          @@r!�%test_virtualClassAttributeWithTwoMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta�s����	1�D�	1�	1�D�	1�	1�E�5�	1�	�u�	�	�V�u�	�������V�,���v��;�h�F���/�/�#�)�)�+�������1�������V�,���v��;�h�F���/�/�#�)�)�+�������1r c��Gd�dt�}Gd�d|��}t�}tj|��}||�tt
z}|j
�j�}|j||�y)Nc��eZdZd�Zy)�.PydocWithMetaClasses.test_buggy_dir.<locals>.Mc�
�gd�S)N)rSr�missing�hererr�s r!r�z6PydocWithMetaClasses.test_buggy_dir.<locals>.M.__dir__s��C�Cr N)rrrr�rr r!�Mrs��
Dr r!c��eZdZdZy)�.PydocWithMetaClasses.test_buggy_dir.<locals>.Czpresent!N)rrrr rr r!r�r#s���Dr r�r�r�)	r�rr2r��!expected_missingattribute_patternrr�r4rt)rmr!r�rEr�r�rws       r!�test_buggy_dirz#PydocWithMetaClasses.test_buggy_dirsg��	D��	D�	�!�	�������V�,���q�	�9�H�D�
����"�(�(�*�������/r c��t�5}tjd�ddd�j�}|j	d|�y#1swY�,xYw)Nz	enum.Enumz
class Enum)rr2r�r�r�)rmrrs   r!�test_resolve_falsez'PydocWithMetaClasses.test_resolve_falsesI���
�	$�'��J�J�{�#�	$��#�#�%���
�
�l�H�-�	$�	$�s�A�AN)rrrr~rr�r�r}rr�r�rr%r'rr r!r�r��s���X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��0��J�0�(�X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��0��J�0�"�X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��'2��J�'2�R�X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��0��J�0�.r r�c�8�eZdZd�Zd	d�Zd�Zd�Zd�Zd�Zd�Z	y)
�TestInternalUtilitiesc�H�tj�}|j|_tj
j
|jd�|_|j|j�t	j�x|_}dtj|g|_
y)N�nonexistentr$)�tempfile�TemporaryDirectoryr�argv0dirrJrKr1�argv0r!�cleanup�getcwd�
abs_curdir�curdir�curdir_spellings)rm�tmpdirr2s   r!r�zTestInternalUtilities.setUp'sj���,�,�.������
��W�W�\�\�&�+�+�}�=��
�������'�')�y�y�{�2���*�!#�R�Y�Y�
� ;��r Nc�J�|�|j}tj||�Srg)r/r2�_get_revised_path)rm�
given_pathr/s   r!r7z'TestInternalUtilities._get_revised_path/s%���=��J�J�E��&�&�z�5�9�9r c���tjj�}|jD]2}t	|j|��D]}|j
|���4|Srg)r�rK�copyr4rW�countrJ)rm�
clean_path�spelling�__s    r!�_get_starting_pathz(TestInternalUtilities._get_starting_path6s[���X�X�]�]�_�
��-�-�	,�H��J�,�,�X�6�7�
,���!�!�(�+�
,�	,��r c��|j�}|jg|z}|j|j|�|�yrg)r?r2rtr7)rmr<�
expected_paths   r!�,test_sys_path_adjustment_adds_missing_curdirzBTestInternalUtilities.test_sys_path_adjustment_adds_missing_curdir>s<���,�,�.�
����)�J�6�
�����/�/�
�;�]�Kr c��|j�}|jg|z}|jg|z}|j|j	|�|�||jgz}|j|j	|�|�yrg)r?r2r.rtr7)rmr<rA�leading_argv0dir�trailing_argv0dirs     r!�*test_sys_path_adjustment_removes_argv0_dirz@TestInternalUtilities.test_sys_path_adjustment_removes_argv0_dirCs{���,�,�.�
����)�J�6�
� �M�M�?�Z�7������/�/�0@�A�=�Q�&�$�-�-��8������/�/�0A�B�M�Rr c����fd�}�j�}�jg|z}�jg|z}�j||�|�|�jgz}�jg|z}�j||�|�y)Nc�F���j|tj��S)N)r/)r7r2r3)r8rms �r!r7z\TestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir.<locals>._get_revised_pathLs����)�)�*�E�N�N�)�K�Kr )r?r.r2rt)rmr7r<rDrArEs`     r!�+test_sys_path_adjustment_protects_pydoc_dirzATestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dirKs����	L��,�,�.�
� �M�M�?�Z�7�����)�,<�<�
����*�+;�<�m�L�&�$�-�-��8�����)�,=�=�
����*�+<�=�}�Mr c���|j�}|jD]�}|j|��5|g|z}|j|j	|��||gz}|j|j	|��|j
g|z}|j|j	|��||j
gz}|j|j	|��ddd���y#1swY��xYw)N)�curdir_spelling)r?r4�subTestr7r7r.)rmr<r=�leading_curdir�trailing_curdirrDrEs       r!�5test_sys_path_adjustment_when_curdir_already_includedzKTestInternalUtilities.test_sys_path_adjustment_when_curdir_already_includedVs����,�,�.�
��-�-�
	M�H����h��7�	
M�"*��j�!8���!�!�$�"8�"8��"H�I�",��z�"9���!�!�$�"8�"8��"I�J�$(�M�M�?�^�#C� ��!�!�$�"8�"8�9I�"J�K�$3�t�}�}�o�$E�!��!�!�$�"8�"8�9J�"K�L�	
M�	
M�
	M�	
M�	
M�s�B-C*�*C3	rg)
rrrr�r7r?rBrFrIrOrr r!r)r)%s)��<�:��L�
S�	N�Mr r)c��tj�}tjtjg|���tjt
�yrg)r�threading_setupr~�addModuleCleanup�threading_cleanupr
)�thread_infos r!�setUpModulerUes8��"�2�2�4�K����.�@�@�O�;�O����m�,r �__main__)\rJr�ry�importlib.utilr2r�r2r6r�rrprRr�r,�test.supportr�r�r�r~�urllib.parser��	xml.etreer��xml.etree.ElementTreer�ior�collectionsr�urllib.requestrrrr�test.support.script_helperr	r
rrr
rrrrrrr�test.support.os_helperrrrrr�support�HAVE_DOCSTRINGSr�r4r�r�r�r��expected_html_data_docstringsr.r�r�r�r�r�rrr$r<r>rGrOrVr]rb�TestCaserdr|r�r�rr�r�r�r�r)rUr�mainrr r!�<module>rfs���	�
���������	�����
�������"�.�&�"�M�M�)�E�E�E�<�;��	�	��<�<��� ��
 0��\�x
�E�G�y�|!&�&I�/G�&I�!I��J��X!&�&I�/G�&I�!I��,�-4�G�D�"�*�*�,E��N��%� 
�E�G�!"�$&�
�E�G�#�&�
�E�G�#�&�,
�E�G�-#�0%�
�E�G�"���������H�%�%��<c3�8�$�$�c3�LX@�m�X@�vO
�x�(�(�O
�d
������W�5��#,�h�'�'�#,�	�#,�L2�-�2�>1��"�"�1�n.�8�,�,�n.�b=M�H�-�-�=M�@-��z���H�M�M�O�r