
    9\hQ                    *   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlmZmZ d dlm Z  d dlm!Z! d dlm"Z" d dl#m$Z$m%Z%m&Z& d d	lm'Z' d d
lm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ d dl0m1Z1m2Z2m3Z3 d dl4m5Z5 d dl4m6Z6  G d d          Z7ej         j8        rdZ9ndZ9d:                                Z; e<d e9D                       Z=dZ> e<d e9D                       Z?d@                    de jA                  ZBdZCd:                                ZDd:                                ZEd:                                ZFd:                                ZGd:                                ZHd ZId ZJd  ZKd! ZLd" ZMd# ZNd$ ZOd% ZP G d& d'ejQ                  ZR G d( d)ejQ                  ZS G d* d+eR          ZT G d, d-ejQ                  ZU G d. d/ejQ                  ZV ejW        e,pe-d0           G d1 d2ejQ                              ZX G d3 d4eR          ZY G d5 d6ejQ                  ZZ G d7 d8ejQ                  Z[ G d9 d:ejQ                  Z\d; Z]e^d<k    r ej_                     dS dS )=    N)StringIO)
namedtuple)urlopen
urlcleanup)support)import_helper)	os_helper)assert_python_okassert_python_failurespawn_python)threading_helper)reap_childrencaptured_outputcaptured_stdoutcaptured_stderris_emscriptenis_wasirequires_docstringsMISSING_C_DOCSTRINGS)TESTFNrmtreeunlink)	pydoc_mod)pydocfodderc                       e Zd Z	 dS )nonasciiN__name__
__module____qualname__     D/opt/python-3.11.14/usr/lib/python3.11/test/test_pydoc/test_pydoc.pyr   r   '   s         Dr"   r   )!dictionary for instance variables%list of weak references to the objectr$   r%   ) r&   r&   r&   a  
NAME
    test.test_pydoc.pydoc_mod - This is a test module for test_pydoc
%s
CLASSES
    builtins.object
        A
        B
        C
    
    class A(builtins.object)
     |  Hello and goodbye
     |  
     |  Methods defined here:
     |  
     |  __init__()
     |      Wow, I have no function!
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__%s
     |  
     |  __weakref__%s
    
    class B(builtins.object)
     |  Data descriptors defined here:
     |  
     |  __dict__%s
     |  
     |  __weakref__%s
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  NO_MEANING = 'eggs'
     |  
     |  __annotations__ = {'NO_MEANING': <class 'str'>}
    
    class C(builtins.object)
     |  Methods defined here:
     |  
     |  get_answer(self)
     |      Return say_no()
     |  
     |  is_it_true(self)
     |      Return self.get_answer()
     |  
     |  say_no(self)
     |  
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |  
     |  __class_getitem__(item)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables
     |  
     |  __weakref__
     |      list of weak references to the object

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

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

VERSION
    1.2.3.4

AUTHOR
    Benjamin Peterson

CREDITS
    Nobody

FILE
    %s
c              #   (   K   | ]}|rd |z   ndV  dS )z
     |      r&   Nr!   .0ss     r#   	<genexpr>r+      sO       &I &I*+ ?@&G&6&:&:R &I &I &I &I &I &Ir"   a{  
test.test_pydoc.pydoc_mod (version 1.2.3.4)
This is a test module for test_pydoc

Modules
    types
    typing

Classes
    builtins.object
    A
    B
    C

class A(builtins.object)
    Hello and goodbye

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

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


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

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

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

Author
    Benjamin Peterson

Credits
    Nobody
c              #   B   K   | ]}|                     d d          V  dS ) &nbsp;N)replacer(   s     r#   r+   r+      sL       &I &I*+ '(iiX&>&> &I &I &I &I &I &Ir"   z~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.
z7problem in %s - ModuleNotFoundError: No module named %ra/  
Help on class DA in module %s:

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

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

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

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

class C(builtins.object)
 |  Data and other attributes defined here:
 |  
 |  here = 'present!'
c                 v    	 || fz   }t          dt          j        g|R i |\  }}}|                                S Nz-B)r
   pydoc__file__stripmodule_nameargsenvrcouterrs         r#   	run_pydocr=   4  sJ     ;. D#D%.G4GGG3GGLBS99;;r"   c                 v    	 || fz   }t          dt          j        g|R i |\  }}}|                                S r2   )r   r3   r4   r5   r6   s         r#   run_pydoc_failr?   >  sJ     ;. D(u~LLLLLLLBS99;;r"   c                     	 t          j                    }|                    |           }|                    t                    pd}|rd|z   dz   }|                                |fS )Nr&   z<br><a href="z">Module Docs</a>)r3   HTMLDoc	docmodule	getdoclocr   r5   )moduledocoutputlocs       r#   get_pydoc_htmlrH   F  sb    ,
-//C]]6""F
--	
"
"
(bC
 <$';;<<>>3r"   c                 .    t          j        dd|           S )Nz.r&   )resub)rE   s    r#   
clean_textrL   O  s    6%S!!!r"   c           	          	 t           j        j        }t           j        j        } | | | |t                                                  }t          j                    }|                    | |          }|S )N)basedir)ospathabspathdirnamer4   r3   TextDocrC   )rD   rQ   rR   rN   rE   rG   s         r#   get_pydoc_linkrT   S  si    2goGgoGgggggggh&7&78899::G
-//C
---
0
0CJr"   c                     	 t          j                    }|                    t                    pd}|rd|z   dz   }|                    |           }t          |          }|                                |fS )Nr&   z
MODULE DOCS
    r0   )r3   rS   rC   r   rB   rL   r5   )rD   rE   rG   rF   s       r#   get_pydoc_textrV   \  sn    ,
-//C
--	
"
"
(bC
 1#c)D0]]6""FF<<>>3r"   c                     |                      d          \  }}}|                     d          \  }}}|                     d          \  }}}|S )Nz</head>z<title>z</title>)	partition)textheader_titles       r#   get_html_titler]   g  sN    >>),,LFAq""9--KAq%//*--KE1aLr"   c           	          	 |                      dd          } |                      dd          } t          j        dd|           } t          j         | ddd	d
dd          } | S )Nz<dd>r0   z<hr>F----------------------------------------------------------------------z<.*?>r&   r.   r-   z&gt;>z&lt;<)r/   rJ   rK   r3   )htmls    r#   	html2textrc   o  sb     <<%%D<<''D6'2t$$D=xfc63GGDKr"   c                   >    e Zd ZddZej        dd            Zd ZdS )PydocBaseTestNc                 h    	 |p$t           j                            t                    gdfd	}|S )Nr&   c                 "     | p||          S Nr!   )rP   prefixonerrordefault_pathwalk_packagess      r#   wrapperz8PydocBaseTest._restricted_walk_packages.<locals>.wrapper  s     =!5vwGGGr"   )Nr&   N)rO   rP   rR   r4   )selfrl   rP   rm   rk   s    `  @r#   _restricted_walk_packagesz'PydocBaseTest._restricted_walk_packages}  sU    	 : 9 9:	H 	H 	H 	H 	H 	H 	Hr"   c              #      K   t           j        }|                     ||          t           _        	 d V  |t           _        d S # |t           _        w xY wrh   )pkgutilrl   ro   )rn   rP   rl   s      r#   restrict_walk_packagesz$PydocBaseTest.restrict_walk_packages  s]      - $ > >}?C!E !E	2EEE$1G!!!MG!1111s   A Ac                 |    t          j        |d          }t          |          }|                     |||           |S )Nz	text/html)r3   _url_handlerr]   assertEqual)rn   urlexpected_titlerY   results        r#   call_url_handlerzPydocBaseTest.call_url_handler  s>    !#{33%%666r"   rh   )r   r   r    ro   
contextlibcontextmanagerrr   ry   r!   r"   r#   re   re   {  s[            2 2 2 2    r"   re   c                   X   e Zd ZdZ ej         eed          o ej                    d          e	d                         Z
 ej         eed          o ej                    d          e	d                         Zd Zd Zd Zd	 Zd
 Zd Ze	d             Zd Zd Zd Zd Zd Zd Zd Zd Zd Z ej         eed          o ej                    d          e	d                         Zd Zd Zd Zd Z d Z!d Z"e	d             Z#d Z$d Z%d  Z&d! Z'd" Z(e	d#             Z)d$ Z*dS )%PydocDocTestNgettrace1trace function introduces __locals__ unexpectedlyc                    t          t                    \  }}t          |          }d |                                D             }d |D             }|d= t                                          }d |D             }|                     ||           t          j        t                    }t          j	        
                    |          }|                     ||           |                     ||           |                     ||           d S )Nc                 6    g | ]}|                                 S r!   r5   r)   lines     r#   
<listcomp>z.PydocDocTest.test_html_doc.<locals>.<listcomp>  s     HHHtdjjllHHHr"   c                     g | ]}||S r!   r!   r   s     r#   r   z.PydocDocTest.test_html_doc.<locals>.<listcomp>  s    :::tT:d:::r"      c                 :    g | ]}||                                 S r!   r   r   s     r#   r   z.PydocDocTest.test_html_doc.<locals>.<listcomp>  s%    JJJ4TJ$**,,JJJr"   )rH   r   rc   
splitlineshtml2text_of_expectedru   inspect
getabsfileurllibparsequoteassertIn)rn   rx   doc_loctext_result
text_linesexpected_linesmod_filemod_urls           r#   test_html_doczPydocDocTest.test_html_doc  s     )33''HH{/E/E/G/GHHH
::z:::
qM.99;;JJ>JJJ^444%i00,$$X..gv&&&h'''gv&&&&&r"   c                     t          t                    \  }}t          |ft          z   t	          j        t                    fz   z  }|                     ||           d S rh   )rV   r   expected_text_patternexpected_text_data_docstringsr   r   ru   )rn   rx   r   expected_texts       r#   test_text_doczPydocDocTest.test_text_doc  s`     )33- 
56 +I6689: 	/////r"   c                     dd l } G d d|j                  }t          j        |          }|                     d|           d S )Nr   c                       e Zd ZdZdZdS )IPydocDocTest.test_text_enum_member_with_value_zero.<locals>.BinaryIntegerr   r   N)r   r   r    zerooner!   r"   r#   BinaryIntegerr     s        DCCCr"   r   zBinaryInteger.zero)enumIntEnumr3   
render_docr   )rn   r   r   rE   s       r#   %test_text_enum_member_with_value_zeroz2PydocDocTest.test_text_enum_member_with_value_zero  sf     		 	 	 	 	DL 	 	 	 }--*C00000r"   c                 n    t          t          j        j                  }|                     d|           d S )Nzxml.etree.elementtree)rT   xmletreeElementTreer   )rn   doc_links     r#   ,test_mixed_case_module_names_are_lower_casedz9PydocDocTest.test_mixed_case_module_names_are_lower_cased  s/    !#)"788-x88888r"   c                 l    t          t          j                  \  }}|                     |dd           d S )Nr&   z'MODULE DOCS incorrectly includes a link)rV   r   r   ru   )rn   rx   r   s      r#   test_issue8225zPydocDocTest.test_issue8225  s4    (33"&OPPPPPr"   c                     t           j        }	 d t           _        t          j                     |t           _        d S # |t           _        w xY wrh   )sysstdinr3   getpager)rn   previous_stdins     r#   test_getpager_with_stdin_nonez*PydocDocTest.test_getpager_with_stdin_none  sA    	'CIN&CIIICI&&&&s	   ; A	c                      G d d          } G d d          }t          j         |                      }t          j         |                      }|                     |                    dd          |           d S )Nc                       e Zd ZdZ dS ))PydocDocTest.test_non_str_name.<locals>.A*   Nr   r!   r"   r#   Ar     s        HHHr"   r   c                       e Zd ZdS ))PydocDocTest.test_non_str_name.<locals>.BNr   r!   r"   r#   Br             Dr"   r   )r3   r   ru   r/   )rn   r   r   adocbdocs        r#   test_non_str_namezPydocDocTest.test_non_str_name  s    	 	 	 	 	 	 	 		 	 	 	 	 	 	 	$$$$c3//66666r"   c                     d}t          t          |          d          }t          |z  }|                     ||d           d S )Ntest.i_am_not_hereasciiz&documentation for missing module found)strr?   missing_patternru   rn   missing_modulerx   expecteds       r#   test_not_herezPydocDocTest.test_not_here  sQ    -^N33W=="^364	6 	6 	6 	6 	6r"   c                     t          dd          }t          j                            dd          }|                     ||           d S )Nz#test.test_pydoc.test_pydoc.nonasciir   )PYTHONIOENCODINGbackslashreplace)r=   r   __doc__encoder   )rn   rx   encodeds      r#   test_not_asciizPydocDocTest.test_not_ascii  sI    @SZ[[["))'3EFFgv&&&&&r"   c                     d}t          t          |          d          }t          |                                z  }|                     ||           d S )Nz test.i_am_not_here r   )r   r?   r   r5   ru   r   s       r#   test_input_stripzPydocDocTest.test_input_strip  sP    /^N33W=="^%9%9%;%;;6*****r"   c                    t           j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           d S )Nz<function stripid at 0x88dcee4>z<function stripid>z <function stripid at 0x01F65390>42z<type 'exceptions.Exception'>)r3   stripidru   )rn   r   s     r#   test_stripidzPydocDocTest.test_stripid  s    -!BCC-	/ 	/ 	/!CDD-	/ 	/ 	/ 	---!@AA8	: 	: 	: 	: 	:r"   c                     	 t          j                    }|                    t                    }d}|                     ||           d S )Nz |  Built-in subclasses:
 |      async_generator
 |      BaseException
 |      builtin_function_or_method
 |      bytearray
 |      ... and \d+ other subclasses)r3   rS   docclassobjectassertRegexrn   rE   rY   snips       r#   )test_builtin_with_more_than_four_childrenz6PydocDocTest.test_builtin_with_more_than_four_children  sJ    	( moo||F##8 	t$$$$$r"   c                     	 t          j                    }|                    t                    }d}|                     ||           d S )Nzc |  Built-in subclasses:
 |      FloatingPointError
 |      OverflowError
 |      ZeroDivisionError)r3   rS   r   ArithmeticErrorr   r   s       r#   test_builtin_with_childz$PydocDocTest.test_builtin_with_child   sH    	$ moo||O,,, 	dD!!!!!r"   c                     	 t          j                    }|                    t                    }d}|                     ||           |                     d|           d S )Nz^ |  Built-in subclasses:
 |      ArithmeticError
 |      AssertionError
 |      AttributeErrorZeroDivisionError)r3   rS   r   	Exceptionr   assertNotInr   s       r#   test_builtin_with_grandchildz)PydocDocTest.test_builtin_with_grandchild;  s_    	* moo||I&&) 	dD!!!,d33333r"   c                     	 t          j                    }|                    t                    }|                     d|           d S NzBuilt-in subclasses)r3   rS   r   r   r   rn   rE   rY   s      r#   test_builtin_no_childz"PydocDocTest.test_builtin_no_child[  sC    	, moo||-...55555r"   c                     	 t          j                    }|                    t                    }|                     d|           d S r   )r3   rS   r   typer   r   s      r#   test_builtin_on_metaclassesz(PydocDocTest.test_builtin_on_metaclassesw  sB    	
 moo||D!!.55555r"   c                    t           dz                                  }t          d          5 }|                    d          \  }}|                                                                dd         }|d                             d          |d<   |                     ||           d d d            d S # 1 swxY w Y   d S )Nabdz-chelp()s   abdiir   zhelp> )r   r   r   communicatedecoderemoveprefixru   )rn   elinesprocr;   r[   oliness         r#   test_fail_help_clizPydocDocTest.test_fail_help_cli  s    !E)5577-(( 	-D%%f--FCZZ\\,,..r"u5Fq	..x88F1IVV,,,		- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-s   A;B44B8;B8c                 l   t                      5 }t          j        |          }|                    d           t          dz  }|                     ||                                                                                    dt          j
                             d d d            d S # 1 swxY w Y   d S )NrF   r   r0   )r   r3   Helperhelpr   ru   getvaluer5   r/   rO   linesep)rn   bufhelperr   s       r#   test_fail_help_output_redirectz+PydocDocTest.test_fail_help_output_redirect  s    ZZ 	Y3\---FKK&.HXs||~~';';'='='E'EdBJ'W'WXXX		Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Ys   BB))B-0B-c                    t           j        }d }d | _        t                      }t          j        |          }t          t                    \  }}d}d                                }t          j	        |          }|t          z   }	|t           _        	 t          d          5 }
t          d          5 }|                    |           |                                                                }|	|ft          z   t!          j        t                    fz   z  }|                     d|
                                           |                     d|                                           |                     ||           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |t           _        d S # |t           _        w xY w)Nc                      d S )Nc                     | S rh   r!   )xs    r#   <lambda>zJPydocDocTest.test_help_output_redirect.<locals>.<lambda>.<locals>.<lambda>  s    ! r"   r!   r!   r"   r#   r  z8PydocDocTest.test_help_output_redirect.<locals>.<lambda>  s     r"   r   ztest.test_pydoc.pydoc_modzO
        Help on module test.test_pydoc.pydoc_mod in test.test_pydoc:

        stdoutstderrr&   )r3   r   maxDiffr   r   rV   r   lstriptextwrapdedentr   r   r   r   r5   r   r   r   ru   )rn   getpager_oldgetpager_newr   r   unusedr   rD   help_headerexpected_help_patternrF   r<   rx   r   s                 r#   test_help_output_redirectz&PydocDocTest.test_help_output_redirect  s    ~,,jjS)))(33, FHH 	 ok22 +.C C%	* ** 
8f **
8.1F###--// 5!(
 =!>!(!3I!>!> @!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 *ENNN\EN))))sU   F8 !F1CF<FF	FF	FF8 F##F8 &F#'F8 8Gc                     d }dt           i|_        t          d          5 }t          j        |           d d d            n# 1 swxY w Y   |                                }|                     d|           d S )Nc                     dS Nr   r!   abcs      r#   r  zAPydocDocTest.test_lambda_with_return_annotation.<locals>.<lambda>      q r"   returnr  zlambda (a, b, c) -> intint__annotations__r   r3   r   r   r   rn   funchelp_iohelptexts       r#   "test_lambda_with_return_annotationz/PydocDocTest.test_lambda_with_return_annotation  s       (#X&& 	'Jt	 	 	 	 	 	 	 	 	 	 	 	 	 	 	##%%/:::::   AA	Ac                 
   d }t           t           t           d|_        t          d          5 }t          j        |           d d d            n# 1 swxY w Y   |                                }|                     d|           d S )Nc                     dS r  r!   r  s      r#   r  zDPydocDocTest.test_lambda_without_return_annotation.<locals>.<lambda>  r  r"   r  r  zlambda (a: int, b: int, c: int)r  r  s       r#   %test_lambda_without_return_annotationz2PydocDocTest.test_lambda_without_return_annotation  s      %(s==X&& 	'Jt	 	 	 	 	 	 	 	 	 	 	 	 	 	 	##%%7BBBBBs   AAAc                    d }t           t           t           t           d|_        t          d          5 }t          j        |           d d d            n# 1 swxY w Y   |                                }|                     d|           d S )Nc                     dS r  r!   r  s      r#   r  zLPydocDocTest.test_lambda_with_return_and_params_annotation.<locals>.<lambda>  r  r"   )r  r  r  r  r  z&lambda (a: int, b: int, c: int) -> intr  r  s       r#   -test_lambda_with_return_and_params_annotationz:PydocDocTest.test_lambda_with_return_and_params_annotation  s      %(sLLX&& 	'Jt	 	 	 	 	 	 	 	 	 	 	 	 	 	 	##%%>IIIIIs   AAAc                 v   t          dddg          }t                      5 }t          j        |           d d d            n# 1 swxY w Y   |                                }|                     d|           |                     d|           |                     d|           |                     d|           d S )NPersonnickname	firstnamezAlias for field number 0zAlias for field number 1r   r   r3   r   r   r   )rn   r)  r  r  s       r#   test_namedtuple_fieldsz#PydocDocTest.test_namedtuple_fields  s    Hz;&?@@ 	'Jv	 	 	 	 	 	 	 	 	 	 	 	 	 	 	##%%j(+++k8,,,0(;;;0(;;;;;r!  c                 N   t          dddgd          }t                      5 }t          j        |           d d d            n# 1 swxY w Y   |                                }|                     d|           |                     d|           |                     d|           d S )	NNTabcdefT)rename_1_replace_asdictr,  )rn   r/  r  r  s       r#   !test_namedtuple_public_underscorez.PydocDocTest.test_namedtuple_public_underscore  s    uenT::: 	'JrNNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	##%%dH%%%j(+++i*****s   AAAc                    |                      t          t                     dD ]}t          t          d|          5 }|dk    r$t	          d                    |          |           t	          d|           t	          d|           d d d            n# 1 swxY w Y   t          j        t          i           }|                     |d	           d S )
N)z
ISO-8859-1UTF-8wencodingr8  z#coding: {})fileu   """line 1: hézline 2: hi"""u   line 1: hé)	
addCleanupr   r   openprintformatr3   synopsisru   )rn   r;  scriptrA  s       r#   test_synopsiszPydocDocTest.test_synopsis  s   '''/ 	8 	8HfcH555 4w&&-..x88vFFFF(v6666oF3333	4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
 ~fb11HX7777	8 	8s   ABB	B	c                     t          j        d          }|j                                        d         }|j        }t          j        |          }|                     ||           d S )NrO   r   )r   import_fresh_moduler   r   
__cached__r3   rA  ru   )rn   rO   r   filenamerA  s        r#   test_synopsis_sourcelessz%PydocDocTest.test_synopsis_sourceless  s\    .t44:((**1-=>(++8,,,,,r"   c                 &   t          j                    5 }t          j                            |d          }t
          j                            |          }t          |d          5 }|	                    d           d d d            n# 1 swxY w Y   t          j        |           t          j        |i           }|                     |           t          j        |i           }|                     |           d d d            d S # 1 swxY w Y   d S )Nzfoomod42.pyr9  foo = 1)r	   temp_cwdrO   rP   join	importlibutilcache_from_sourcer>  write
py_compilecompiler3   rA  assertIsNone)rn   test_dir	init_pathcached_pathfobjrA  synopsis_cacheds          r#   "test_synopsis_sourceless_empty_docz/PydocDocTest.test_synopsis_sourceless_empty_doc  sk   !! 		/XX}==I#.::9EEKi%% &

9%%%& & & & & & & & & & & & & & &y)))~i44Hh'''#n["==Oo...		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/ 		/s7   AD$B:DB
	
DB
	A+DD
D
c                 Z    d}|                      t          j        |          d           d S )Nz#I Am A Doc


Here is my description)z
I Am A Docz
Here is my description)ru   r3   splitdoc)rn   example_strings     r#   test_splitdoc_with_descriptionz+PydocDocTest.test_splitdoc_with_description  s=    A77C	E 	E 	E 	E 	Er"   c                     t          j                    5 }|                     t          j        |                     d d d            d S # 1 swxY w Y   d S rh   )r	   rK  assertFalser3   	ispackage)rn   rT  s     r#    test_is_package_when_not_packagez-PydocDocTest.test_is_package_when_not_package  s    !! 	8X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   t          j                    5 }t          j                            |d          }t          |d                                           |                     t          j	        |                     t          j
        |           d d d            d S # 1 swxY w Y   d S )N__init__.pyr9  )r	   rK  rO   rP   rL  r>  close
assertTruer3   r`  remove)rn   rT  rU  s      r#   test_is_package_when_is_packagez,PydocDocTest.test_is_package_when_is_package
  s    !! 	!XX}==IC  &&(((OOEOH55666Ii   		! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!s   A>BB#&B#c                 
    G d dt                     }t          t          t                               }|j        |d<   |d= |d= |j        |d<   |j        |d<   t          j        |          }|                     ||           d S )Nc                       e Zd Zd ZdS )/PydocDocTest.test_allmethods.<locals>.TestClassc                     dS )NTr!   rn   s    r#   method_returning_truezEPydocDocTest.test_allmethods.<locals>.TestClass.method_returning_true  s    tr"   N)r   r   r    rm  r!   r"   r#   	TestClassrj    s#            r"   rn  rm  r   	__class____subclasshook____init_subclass__)	r   dictvarsrm  rp  rq  r3   
allmethodsassertDictEqual)rn   rn  r   methodss       r#   test_allmethodszPydocDocTest.test_allmethods  s    	 	 	 	 	 	 	 	
 V%%,5,K()Y[! (1'A#$(1(C$%"9--Wh/////r"   c                     G d d           G fdd          }t          j        |          }t          |          }|                     |dt          z             t          j        |t          j                              }dt           d}t          |          }d	 |                    d
          D             }|D ]}|                     ||           d S )Nc                        e Zd ZddZeZd ZdS )+PydocDocTest.test_method_aliases.<locals>.ANc                     d S rh   r!   )rn   	aboveThiss     r#   tkraisez3PydocDocTest.test_method_aliases.<locals>.A.tkraise-  s    >>r"   c                     d S rh   r!   rl  s    r#   a_sizez2PydocDocTest.test_method_aliases.<locals>.A.a_size0  s    !!r"   rh   )r   r   r    r}  liftr  r!   r"   r#   r   rz  ,  s<        ? ? ? ?D" " " " "r"   r   c                   *    e Zd ZddZeZ j        ZdS )+PydocDocTest.test_method_aliases.<locals>.BNc                     d S rh   r!   )rn   tagOrIdcnfkws       r#   itemconfigurez9PydocDocTest.test_method_aliases.<locals>.B.itemconfigure3  s    ==r"   rh   )r   r   r    r  
itemconfigr  b_size)r   s   r#   r   r  2  s/        > > > >&JXFFFr"   r   a  Python Library Documentation: class B in module %s

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

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

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

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

    Data descriptors inherited from A:
        __dict__
            dictionary for instance variables
        __weakref__
            list of weak references to the object
c                 :    g | ]}||                                 S r!   r   r   s     r#   r   z4PydocDocTest.test_method_aliases.<locals>.<listcomp>  s&    UUU4PTU$**,,UUUr"   r0   )	r3   r   rL   ru   r   rA   rc   splitr   )rn   r   rE   r   as_textr   expected_liner   s          @r#   test_method_aliasesz PydocDocTest.test_method_aliases*  s>   	" 	" 	" 	" 	" 	" 	" 	"	 	 	 	 	 	 	 	 	 	 q!!oo %J K% %	 %	 %	N q5=??;;;   : C..UU=3F3Ft3L3LUUU+ 	2 	2MMM-1111	2 	2r"   c                    dd l }t          |          \  }}t          |          \  }}t          t                    \  }}t          t                    \  }}|j        D ]e}| d}d| d}	|                     ||           |                     |	|           |                     ||           |                     |	|           fd S )Nr   z = _Featurez<strong>z</strong> = _Feature)
__future__rV   rH   r   all_feature_namesr   r   )
rn   r  future_textr[   future_htmlpydoc_mod_textpydoc_mod_htmlfeaturetxtrb   s
             r#   test__future__importsz"PydocDocTest.test__future__imports  s     	'
33Q'
33Q*955*955!3 	3 	3G)))C;g;;;DMM#{+++MM$,,,S.111T>2222	3 	3r"   )+r   r   r    r  unittestskipIfhasattrr   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r$  r'  r-  r6  rC  rH  rY  r]  ra  rg  rw  r  r  r!   r"   r#   r}   r}     s        GX_WWS*--@,#,..HJ J' ' J J' X_WWS*--@,#,..HJ J0 0 J J01 1 19 9 9
Q Q Q
' ' '
7 
7 
76 6 6 ' ' '
+ + +: : :% % %>" " "64 4 4@6 6 68	6 	6 	6- - -Y Y Y X_WWS*--@,#,..HJ J *  * J J *D; ; ;C C CJ J J< < <+ + +	8 	8 	8 - - -
/ 
/ 
/E E E
8 8 8! ! !0 0 02 W2 W2 W2r3 3 3 3 3r"   r}   c                      e Zd Zd Zd Zd Zd Zej         e	j
        ed          d                         Zd Z e	j        d          d	             Z e	j        d          d
             Z e	j        d          d             Zd ZdS )PydocImportTestc                     t          j        t                    | _        |                     t
          t                     t          j                     d S rh   )rO   mkdirr   rT  r=  r   rM  invalidate_cachesrl  s    r#   setUpzPydocImportTest.setUp  s<    (('''#%%%%%r"   c                 B   d}dddd                     |          dfd                     |          d                     |          ff}t          j                            t          |          t          j        z   dz   }|D ]\  }}t          |d	          5 }|                    d
                     |                     d d d            n# 1 swxY w Y   t          |t                    	                    d          }t          ||fz  }|                     ||           d S )Ntestmod_xyzzy)i_am_not_herer  )test.i_am_not_here_eitherr  )ztest.i_am_not_here.neither_am_ir   zi_am_not_here.{}r  ztest.{}pyr9  z
import {}
)
PYTHONPATHr   )r@  rO   rP   rL  r   extsepr>  rP  r?   r   badimport_patternru   )	rn   modname	testpairssourcefnimportstringexpectedinmsgfrx   r   s	            r#   test_badimportzPydocImportTest.test_badimport  s^    ".FE&&w//Ag&&	(8(8(A(AB	 7<<0029<tC+4 	/ 	/'L-h$$ <,,\::;;;< < < < < < < < < < < < < < <#G???FFwOOF(G]+CCHXv....	/ 	/s   )CC	C	c                    t           j                            t          d          }t          j        |           t           j                            |d          t           j        z   dz   }t          |d          5 }|                    d           d d d            n# 1 swxY w Y   |                     t          g          5  t                      5 }t                      5 }t          j        d           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                     |                                d           |                     |                                d           t                      5 }t                      5 }t          j        d           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                     |                                                                d           |                     |                                d           d d d            d S # 1 swxY w Y   d S )	N	syntaxerr__init__r  r9  zinvalid python syntax = $1
rP   xyzzyr&   )rO   rP   rL  r   r  r  r>  rP  rr   r   r   r3   aproposru   r   r5   )rn   pkgdir	badsyntaxr  r;   r<   s         r#   test_apropos_with_bad_packagez-PydocImportTest.test_apropos_with_bad_package  sZ   fk22
GLL44ry@4G	)S!! 	4QGG2333	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4((vh(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	2F66G	9F6:G	=I	G	IG	A%II
Ic                    t           j                            t          d          | _        t          j        | j        d           |                     t           j        | j                   |                     t          g          5  t                      5 }t                      5 }t          j        d           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                     |                                d           |                     |                                d           d S )N
unreadabler   r  SOMEKEYr&   )rO   rP   rL  r   unreadable_dirr  r=  rmdirrr   r   r   r3   r  ru   r   )rn   r;   r<   s      r#    test_apropos_with_unreadable_dirz0PydocImportTest.test_apropos_with_unreadable_dir  s    gll6<@@
$a((($"5666 ((vh(77 	- 	- "" -c$&& -#M),,,- - - - - - - - - - - - - - -- - - - - - - - - - - - - - -	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-
 	,,,,,,,,sZ   C3C$C9CC		CC	CC3C 	 C3#C 	$C33C7:C7zcannot remove x bitc                    t           j                            t          d          }t          j        |           |                     t          |           t           j                            |d          }t          |d          5 }|                    d           d d d            n# 1 swxY w Y   t          j
        t          j	        |          j                  }	 t          j        ||t          j         z             |                     t          g          5  t                      5 }t!          j        d           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                     d|                                           t          j        ||           d S # t          j        ||           w xY w)Nwalkpkgrc  r9  rJ  r  r&   )rO   rP   rL  r   r  r=  r   r>  rP  statS_IMODEst_modechmodS_IEXECrr   r   r3   r  r   r   )rn   r  rU  rW  current_moder  s         r#   test_apropos_empty_docz&PydocImportTest.test_apropos_empty_doc  s*    fi00
'''GLL77	)S!! 	"TJJy!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"|BGFOO$;<<	+HV\T\M9:::,,6(,;; " "_=N=N "RXb!!!" " " " " " " " " " " " " " " " " " " " " " " " " " " " " "MM)V__%6%6777HV\*****BHV\****sf   B''B+.B+?F. E$,EE$E	E$E	E$F. $E((F. +E(,+F. .Gc                 :   t           j                            t          d          }t          j        |           t           j                            |d          }t          |dd          5 }|                    d           d d d            n# 1 swxY w Y   |                     t          g          5  t          t          j                  }t          j        
                    dt                     	 |                     t          d	          5  dd l}d d d            n# 1 swxY w Y   |                     d
d          }d}|                     ||           |t          j        d d <   n# |t          j        d d <   w xY w	 d d d            d S # 1 swxY w Y   d S )Ntest_error_packagerc  wtr   r:  zraise ValueError("ouch")
r  r   ouchzsearch?key=test_error_packagePydoc: Search Resultsz8<a href="test_error_package.html">test_error_package</a>)rO   rP   rL  r   r  r>  rP  rr   tupler   insertassertRaisesRegex
ValueErrorr  ry   r   )rn   r  initr  saved_pathsr  rY   founds           r#   test_url_search_package_errorz-PydocImportTest.test_url_search_package_error  s9   f&:;;
w||FM22$w/// 	61GG4555	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6((vh(77 	* 	*//KHOOAv&&&
*++J?? . .----. . . . . . . . . . . . . . . ,,-L+- --eT***)k))))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*s`   ,BBB5?F5E,D!E,!D%	%E,(D%	)1E,F,E??FFFz(causes undesirable side-effects (#20128)c                 8   d}d}d}||z   |z   }t                      }t          j        |          } |d           |                                                                }t          |                                          }|                     ||           d S )N         r   modules)r   r3   r   r   r5   lenr   assertGreaterEqual)	rn   num_header_linesnum_module_lines_minnum_footer_linesr   rF   r   rx   	num_liness	            r#   test_moduleszPydocImportTest.test_modules  s      #&::=MMV,,,y""((**))++,,		844444r"   c                    d}t                      }t          j        |          }t                      5 } |d           d d d            n# 1 swxY w Y   |                                }|                     ||           d S )Nzpydoc - r   zmodules pydoc)r   r3   r   r   r   r   rn   r   rF   r   r  rx   s         r#   test_modules_searchz#PydocImportTest.test_modules_search  s     V,,, 	$'F?###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$!!##h'''''   AAAz+some buildbots are not cooperating (#20128)c                 *   d}t                      }t          j        |          }t                      5 } |d           d d d            n# 1 swxY w Y   |                                }|                     |                    |                     d S )Nzgc - r   zmodules garbage)r   r3   r   r   r   re  
startswithr  s         r#   test_modules_search_builtinz+PydocImportTest.test_modules_search_builtin  s    V,,, 	&'F$%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&!!##))(3344444r  c                 B   t          j        t           j                  }|                     |t                      |                     |j        d           |                     |j        t           j                   |                     |j        t           j                   d S )Nr3   )r3   
importfiler4   assertIsNotru   r   __spec__)rn   loaded_pydocs     r#   test_importfilezPydocImportTest.test_importfile(  s    '77u---.888.???.?????r"   N)r   r   r    r  r  r  r  r	   skip_unless_working_chmodr  r  r   r  r  skipr  r  r  r  r!   r"   r#   r  r    s(       & & &
/ / /*1 1 1*- - - (X_]$9::+ + ;: )(+ * * *. X]=>>5 5 ?>5 X]=>>
( 
( ?>
( X]@AA	5 	5 BA	5@ @ @ @ @r"   r  c                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	e
d             Ze
d	             Zd
 Zed             Zd Zd Zed             Zed             Zd Zd Zed             Zed             Zed             Zed             Zed             Zed             Zed             Zed             Zed             Zed             Zed             Z d Z!d Z"ed             Z#d S )!TestDescriptionsc                 d    t          j        t                    }|                     d|           d S )Nr   )r3   r   r   r   rn   rE   s     r#   test_modulezTestDescriptions.test_module3  s,    {++mS)))))r"   c                 8    G d d          } |            }|                      t          j        |          d           |                      t          j        |          d           dt          z  }|                     |t          j        |                     d S )Nc                       e Zd ZdS )&TestDescriptions.test_class.<locals>.CNr   r!   r"   r#   Cr  9            r"   r  zclass CzC in module %s object)ru   r3   describer   r   r   )rn   r  r  r   s       r#   
test_classzTestDescriptions.test_class8  s    """"""""ACC**I666**C000*X5h 0 3 344444r"   c                    |                      t          j        t          j        t
                             d           t          j        t          j        t
                   t          j                  }|                     d|           |                     d|           t          sJ|                     t          j                                                                        d         |           |                      t          j        t          t
                             d           t          j        t          t
                   t          j                  }|                     d|           |                     d|           t          sL|                     t          j                                                                        d         |           d S d S )	N_GenericAliasr  z_GenericAlias in module typingzList = class list(object)r   GenericAliaszGenericAlias in module builtinsz
class list(object))ru   r3   r  typingListr  r   	plaintextr   r   listr   r5   r   r  s     r#   test_generic_aliasz#TestDescriptions.test_generic_aliasA  sd   C(899?KKKv{3/%/JJJ6<<<13777# 	EMM$,,,..99;;A>DDDS	22NCCCtCy5?CCC7===,c222# 	EMM$,,,..99;;A>DDDDD	E 	Er"   c                    |                      t          j        t          j        t
          t          f                   d           t          j        t          j        t
          t          f         t          j                  }| 	                    d|           | 	                    d|           t          j        j
        rO| 	                    t          j        j
                                                                        d         |           |                      t          j        t
          t          z            d           t          j        t
          t          z  t          j                  }| 	                    d|           | 	                    d|           t          sQ| 	                    t          j        j
                                                                        d         |           d S d S )	N_UnionGenericAliasr  z#_UnionGenericAlias in module typingzUnion = typing.Unionr   	UnionTypez UnionType in module types objectz!
class UnionType(builtins.object))ru   r3   r  r  Unionr  r   r   r  r   r   r5   r   r   typesr	  r  s     r#   test_union_typez TestDescriptions.test_union_typeP  sx   S#X(>??AUVVVv|CH5PPP;SAAA,c222< 	MMM&,.4466AACCAFLLLc	22K@@@sSy5?CCC8#>>>:C@@@# 	PMM%/17799DDFFqI3OOOOO	P 	Pr"   c                    |                      t          j        t          j                  d           t          j        t          j        t          j                  }|                     d|           t          j        j        rg|                     d|           |                     t          j        j        	                                
                                d         |           d S |                     d|           d S )N_SpecialFormr  z_SpecialForm in module typingzNoReturn = typing.NoReturnr   z%NoReturn = class _SpecialForm(_Final))ru   r3   r  r  NoReturnr   r  r   r   r5   r   r  s     r#   test_special_formz"TestDescriptions.test_special_form_  s    88.IIIvIII5s;;;?" 	HMM6<<<MM&/17799DDFFqI3OOOOOMMA3GGGGGr"   c           	      X   dt           j        t           j                 dt          dt           j        t           j        t          t           j        f                  fd}t          j        d          } G d dt           j        |         t           j        t          t          f                   }| 
                    t          j        |                                          d         d	           | 
                    t          j        |                                          d
         d           d S )Ndatar  r  c                     d S rh   r!   )r  r  s     r#   fooz/TestDescriptions.test_typing_pydoc.<locals>.fooj  s    Cr"   Tc                       e Zd ZdS )-TestDescriptions.test_typing_pydoc.<locals>.CNr   r!   r"   r#   r  r  n  r  r"   r  z?ffoooo(data: List[Any], x: int) -> Iterator[Tuple[int, Any]]r  z2class CC(collections.abc.Mapping, typing.Generic))r  r  Anyr  IteratorTupleTypeVarGenericMappingr   ru   r3   r   r   )rn   r  r  r  s       r#   test_typing_pydocz"TestDescriptions.test_typing_pydoci  s   	fk&*- 		!?6<VZ+HI	 	 	 	 N3AAAAAq!6>#s(#;AAA)#..99;;B?9	: 	: 	: 	)!,,7799!<P	R 	R 	R 	R 	Rr"   c                    dD ]v}|                      t          j        |                     	 t          j        |           ?# t          $ r+ |                     d                    |                     Y sw xY wdD ]O}|                     t          j        |                     |                     t          t          j        |           Pd S )N)r   zstr.translatezbuiltins.strzbuiltins.str.translatezfinding the doc of {!r} failed)notbuiltinsstrrrzstrr.translatezstr.trrrranslatezbuiltins.strrrzbuiltins.str.trrranslate)	assertIsNotNoner3   locater   ImportErrorfailr@  rS  assertRaises)rn   names     r#   test_builtinzTestDescriptions.test_builtinu  s    / 	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 el400111k5+;TBBBB		C 	Cs   A2A76A7c                     t          j        t          j        |                     }|                    d          }|d         S Nr0   r  )r3   plainr   r  orY   liness      r#   _get_summary_linez"TestDescriptions._get_summary_line  s6    {5+A..//

4  Qxr"   c                     t          j        t          j        |                     }|                    d          }d                    |dd                    S r+  )r3   r,  r   r  rL  r-  s      r#   _get_summary_linesz#TestDescriptions._get_summary_lines  sG    {5+A..//

4  yyqrr###r"   c                 v    |                      |                     t          j        j                  d           d S )Nzwrap(self, text))ru   r0  r  TextWrapperwraprl  s    r#   test_unbound_python_methodz+TestDescriptions.test_unbound_python_method  s=    //0D0IJJ	  	  	  	  	 r"   c                 v    |                      |                     t          j        j                  d           d S )Nz1dump(self, obj, /) unbound _pickle.Pickler method)ru   r0  _picklePicklerdumprl  s    r#   test_unbound_builtin_methodz,TestDescriptions.test_unbound_builtin_method  sA    //0DEE?	A 	A 	A 	A 	Ar"   c                     t          j                    }|                     |                     |j                  d           d S )Nz2wrap(text) method of textwrap.TextWrapper instance)r  r4  ru   r0  r5  )rn   ts     r#   test_bound_python_methodz)TestDescriptions.test_bound_python_method  sL     ""//77@	B 	B 	B 	B 	Br"   c                    t          dg d          }t          j        |          }|                     |                    d          |                    d                     |                     |                    d          |                    d                      G d d          } G d d	          }t          j        |           t          j        |           d S )
Nr)  )r*  r+  agegroupr*  r+  r@  c                       e Zd ZdZdS )MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonIterableFieldsNr   r   r    _fieldsr!   r"   r#   NonIterableFieldsrB    s        GGGr"   rE  c                       e Zd Zg gZdS )MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonHashableFieldsNrC  r!   r"   r#   NonHashableFieldsrG    s        dGGGr"   rH  )r   r3   r   
assertLessindex)rn   r)  r*   rE  rH  s        r#   !test_field_order_for_named_tuplesz2TestDescriptions.test_field_order_for_named_tuples  s    H&K&K&KLLV$$
++QWW[-A-ABBB,,aggj.A.ABBB	 	 	 	 	 	 	 		 	 	 	 	 	 	 	 	*+++*+++++r"   c                     t                      }t          j        |          }|                     |                     |j                  d           d S )Nz/dump(obj, /) method of _pickle.Pickler instance)r   r8  r9  ru   r0  r:  )rn   r*   ps      r#   test_bound_builtin_methodz*TestDescriptions.test_bound_builtin_method  sQ    JJOA//77=	? 	? 	? 	? 	?r"   c                 l    |                      |                     t          j                  d           d S )Nz0stat(path, *, dir_fd=None, follow_symlinks=True))ru   r0  rO   r  rl  s    r#   test_module_level_callablez+TestDescriptions.test_module_level_callable  s>    //88>	@ 	@ 	@ 	@ 	@r"   c                 l    |                      |                     t          j                  d           d S )Nz*lower(self, /) unbound builtins.str method)ru   r0  r   lowerrl  s    r#   "test_unbound_builtin_method_noargsz3TestDescriptions.test_unbound_builtin_method_noargs  s9    //	::8	: 	: 	: 	: 	:r"   c                 b    |                      |                     dj                  d           d S )Nr&   z'lower() method of builtins.str instance)ru   r0  rR  rl  s    r#    test_bound_builtin_method_noargsz1TestDescriptions.test_bound_builtin_method_noargs  s9    //995	7 	7 	7 	7 	7r"   c                 X    G d d          }|                      |                     |j        d                   d           |                      |                     |j                  d           |                     dt          j        t          j        |                               d S )Nc                   $    e Zd Zed             ZdS )-TestDescriptions.test_staticmethod.<locals>.Xc                     	 d S rh   r!   r  ys     r#   smz0TestDescriptions.test_staticmethod.<locals>.X.sm  s
    %r"   N)r   r   r    staticmethodr\  r!   r"   r#   XrX    s-          \  r"   r^  r\  zsm(x, y)
    A static method
zL
 |  Static methods defined here:
 |  
 |  sm(x, y)
 |      A static method
)ru   r2  __dict__r\  r   r3   r,  r   rn   r^  s     r#   test_staticmethodz"TestDescriptions.test_staticmethod  s    	 	 	 	 	 	 	 	
 	00D1ABB1	2 	2 	2 	0066 9 	 	 	 	 
 [!!$$%%	' 	' 	' 	' 	'r"   c                 X    G d d          }|                      |                     |j        d                   d           |                      |                     |j                  d           |                     dt          j        t          j        |                               d S )Nc                   $    e Zd Zed             ZdS ),TestDescriptions.test_classmethod.<locals>.Xc                     	 d S rh   r!   )clsr  s     r#   cmz/TestDescriptions.test_classmethod.<locals>.X.cm  s
    $r"   N)r   r   r    classmethodrg  r!   r"   r#   r^  rd    s-          [  r"   r^  rg  zcm(...)
    A class method
zFcm(x) class method of test.test_pydoc.test_pydoc.X
    A class method
zG
 |  Class methods defined here:
 |  
 |  cm(x)
 |      A class method
)ru   r2  r_  rg  r   r3   r,  r   r`  s     r#   test_classmethodz!TestDescriptions.test_classmethod  s    	 	 	 	 	 	 	 	
 	00D1ABB0	1 	1 	1 	0066 9 	 	 	 	 
 [!!$$%%	' 	' 	' 	' 	'r"   c                    |                      |                     t          j                  d           |                      |                     t          j                  d           |                      |                     t          j                  d           |                      |                     t          j	                  d           d S )N	numeratorrealr8   obj)
ru   r0  r  rk  floatrl  r   r8   
memoryviewrm  rl  s    r#   test_getset_descriptorz'TestDescriptions.test_getset_descriptor  s     	//>>LLL//
;;VDDD//	??HHH//
??GGGGGr"   c                    |                      |                     t          j                  d           |                      |                     t          j                  d           |                      |                     t          j                  d           |                      |                     t          j                  d           |                      |                     t          j
                  d           d S )Nrl  startfgetvalue)ru   r0  complexrl  rangerr  slicepropertyrs  StopIterationrt  rl  s    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DgNNNNNr"   c                 |     G d d          }|                      |                     |j                  d           d S )Nc                       e Zd ZdZdS )4TestDescriptions.test_slot_descriptor.<locals>.PointrZ  N)r   r   r    	__slots__r!   r"   r#   Pointr}    s         IIIr"   r  r  )ru   r0  r  )rn   r  s     r#   test_slot_descriptorz%TestDescriptions.test_slot_descriptor  sV    	! 	! 	! 	! 	! 	! 	! 	!//88#>>>>>r"   c                      G d d          }|                      |                     |j        d                   d           d S )Nc                       e Zd ZdS )6TestDescriptions.test_dict_attr_descriptor.<locals>.NSNr   r!   r"   r#   NSr    r   r"   r  r_  )ru   r0  r_  )rn   r  s     r#   test_dict_attr_descriptorz*TestDescriptions.test_dict_attr_descriptor
  sf    	 	 	 	 	 	 	 	//J0GHH#	% 	% 	% 	% 	%r"   c                 .   |                      |                     t          t          j                  j                  d           |                      |                     t          t          j                  j                  d           |                      |                     t          t          j                  j	                  d           |                      |                     t          t          j
                  j                  d           d S )Nwidthdebugmajormax)ru   r0  r   r   	hash_infor  flagsr  version_infor  
float_infor  rl  s    r#    test_structseq_member_descriptorz1TestDescriptions.test_structseq_member_descriptor  s    //S]0C0C0IJJ 	" 	" 	"//SY0EFF 	" 	" 	"//S5E0F0F0LMM 	" 	" 	"//S^0D0D0HII	  	  	  	  	 r"   c                     t          dd          }|                     |                     |j                  d           d S )NBox)r  heightz    Alias for field number 0
)r   ru   r2  r  )rn   r  s     r#    test_namedtuple_field_descriptorz1TestDescriptions.test_namedtuple_field_descriptor  sK     34400;; > 	 	 	 	 	r"   c                      G d d          }|                      |                     |j                  d           |                     dt	          j        t	          j        |                               d S )Nc                   $    e Zd Zed             ZdS ),TestDescriptions.test_property.<locals>.Rectc                 "    	 | j         | j        z  S rh   )r9  hrl  s    r#   areaz1TestDescriptions.test_property.<locals>.Rect.area&  s    &v&r"   N)r   r   r    rx  r  r!   r"   r#   Rectr  %  s-        ' ' X' ' 'r"   r  z    Area of the rect
z#
 |  area
 |      Area of the rect
)ru   r2  r  r   r3   r,  r   )rn   r  s     r#   test_propertyzTestDescriptions.test_property#  s    	' 	' 	' 	' 	' 	' 	' 	' 	00;; > 	 	 	 	  [!$''((	* 	* 	* 	* 	*r"   c                     G d d           G fdd          }|                      |                     |j                  dt           d           d|j        _        |                      |                     |j                  dt           d           d	|j        _        |                      |                     |j                  d
           d S )Nc                       e Zd Zd ZdS )?TestDescriptions.test_custom_non_data_descriptor.<locals>.Descrc                     || S dS Nr   r!   rn   rm  rf  s      r#   __get__zGTestDescriptions.test_custom_non_data_descriptor.<locals>.Descr.__get__6      ;Krr"   N)r   r   r    r  r!   r"   r#   Descrr  5  s#            r"   r  c                   $    e Zd Z              ZdS );TestDescriptions.test_custom_non_data_descriptor.<locals>.XNr   r   r    attrr  s   r#   r^  r  :          577DDDr"   r^  ra   zH.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>Custom descriptorz_.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>
    Custom descriptor
r  zfoo(...)
    Custom descriptor
)ru   r2  r  r   r   rn   r^  r  s     @r#   test_custom_non_data_descriptorz0TestDescriptions.test_custom_non_data_descriptor3  s7   	 	 	 	 	 	 	 	
	 	 	 	 	 	 	 	 	 	 	0088 ;W
;W ;W ;W 	X 	X 	X -0088 ;
; ; ; 	 	 	
  0088 ; 	 	 	 	 	r"   c                     G d d           G fdd          }|                      |                     |j                  d           d|j        _        |                      |                     |j                  d           d|j        _        |                      |                     |j                  d	           d S )
Nc                       e Zd Zd Zd ZdS );TestDescriptions.test_custom_data_descriptor.<locals>.Descrc                     || S dS r  r!   r  s      r#   r  zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__get__O  r  r"   c                     ddz   d S )Nr   r   r!   r  s      r#   __set__zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__set__S  s    !r"   N)r   r   r    r  r  r!   r"   r#   r  r  N  s2              r"   r  c                   $    e Zd Z              ZdS )7TestDescriptions.test_custom_data_descriptor.<locals>.XNr  r  s   r#   r^  r  U  r  r"   r^  r&   r  z    Custom descriptor
r  zfoo
    Custom descriptor
)ru   r2  r  r   r   r  s     @r#   test_custom_data_descriptorz,TestDescriptions.test_custom_data_descriptorL  s   	 	 	 	 	 	 	 		 	 	 	 	 	 	 	 	 	 	0088"===,0088 ; 	 	 	  0088 ; 	 	 	 	 	r"   c                 "   dt           fd}t          j        t          j                            |                    }|                     d|           t          j                                        |          }|                     d|           d S )Nr  c                 
   K   dS r  r!   )igns    r#   coro_functionz=TestDescriptions.test_async_annotation.<locals>.coro_functionf  s      1r"   zasync coro_functionz4async <a name="-coro_function"><strong>coro_function)r  r3   r,  r  documentr   rA   )rn   r  rY   rb   s       r#   test_async_annotationz&TestDescriptions.test_async_annotatione  s    	 	 	 	 	 {5?33MBBCC+T222}''66B	 	 	 	 	r"   c                    d }t          j        t           j                            |                    }|                     d|           t          j                                        |          }|                     d|           d S )Nc                    K   dW V  d S r  r!   r!   r"   r#   an_async_generatorzLTestDescriptions.test_async_generator_annotation.<locals>.an_async_generatorr  s      GGGGGGr"   zasync an_async_generatorz>async <a name="-an_async_generator"><strong>an_async_generator)r3   r,  r  r  r   rA   )rn   r  rY   rb   s       r#   test_async_generator_annotationz0TestDescriptions.test_async_generator_annotationq  s    	 	 	 {5?334FGGHH0$777}''(:;;L	 	 	 	 	r"   c                     d }t          j                                        |          }|                     d|           d S )Nc                      	 d S rh   r!   r!   r"   r#   a_fn_with_https_linkzHTestDescriptions.test_html_for_https_links.<locals>.a_fn_with_https_link  s
    +Dr"   z3<a href="https://localhost/">https://localhost/</a>)r3   rA   r  r   )rn   r  rb   s      r#   test_html_for_https_linksz*TestDescriptions.test_html_for_https_links}  sS    	 	 	 }''(<==A	
 	
 	
 	
 	
r"   N)$r   r   r    r  r  r  r  r  r  r)  r]  r0  r2  r6  r   r;  r>  rK  rN  rP  rS  rU  ra  ri  rp  rz  r  r  r  r  r  r  r  r  r  r  r!   r"   r#   r  r  1  s       * * *
5 5 5E E EP P PH H H
R 
R 
RC C C"   \ $ $ \$      A A A
B B B, , ,  ? ? ? @ @ @: : :7 7 7 ' ' '( ' ' '( H H H O O O ? ? ?
 % % %          * * *   0   0
 
 

 
 
 	
 	
 	
 	
 	
r"   r  c                   T    e Zd Zd Zej        fdZej        fdZd Zd Z	d Z
d ZdS )	PydocFodderTestc                     |                                 }d\  }}||                    |          }||                    ||          }|||         S )N)r   N)r   rJ  )rn   rY   	beginlineendliner/  
beginindexendindexs          r#   
getsectionzPydocFodderTest.getsection  s[    !!&
H Y//J{{7J77HZ())r"   c                 $   t          j                    }|                    |          }t          |          }|t          j        u rdnd}|                     |d| dd          }|                     d|           |                     d|           |                     d|           |                     d	|           |                     d
|           |                     d|           |                     d|           |                     d|           |                     d|           |                     |d| dd          }|                     d|           |t          j        u rdnd}|                     d|z   |           |                     d|           |                     d|           |                     d|           |                     |d| dd          }|                     d|           |                     d|           d S )Ndefined hereinherited from Bz |  Methods :zJ |  ----------------------------------------------------------------------z# |  A_method_alias = A_method(self)z# |  B_method_alias = B_method(self)z; |  A_staticmethod(x, y) from test.test_pydoc.pydocfodder.Az/ |  A_staticmethod_alias = A_staticmethod(x, y)z6 |  global_func(x, y) from test.test_pydoc.pydocfodderz) |  global_func_alias = global_func(x, y)zL |  global_func2_alias = global_func2(x, y) from test.test_pydoc.pydocfodderz* |  __repr__(self, /) from builtins.objectz# |  object_repr = __repr__(self, /)z |  Static methods zV |  A_classmethod_ref = A_classmethod(x) class method of test.test_pydoc.pydocfodder.Ar&   . class method of test.test_pydoc.pydocfodder.Bz( |  B_classmethod_ref = B_classmethod(x)zN |  A_method_ref = A_method() method of test.test_pydoc.pydocfodder.A instancez> |  get(key, default=None, /) method of builtins.dict instancezI |  dict_get = get(key, default=None, /) method of builtins.dict instancez |  Class methods z |  B_classmethod(x)z* |  B_classmethod_alias = B_classmethod(x))r3   rS   r   rL   r   r   r  r   rn   rf  rE   rx   wherer/  notes          r#   test_text_doc_routines_in_classz/PydocFodderTest.test_text_doc_routines_in_class  s   mooc""F##"%"6"6<N(?u(?(?(?QQ;UCCC;UCCCSUZ[[[GOOONPUVVVA5IIIdfklllBEJJJ;UCCC(Fe(F(F(FXXnpuvvvKM))rr/_@4GOOOfhmnnnVX]^^^achiii(EU(E(E(EWW,e444BEJJJJJr"   c                    t          j                    }|                    |          }t          |          }|t          j        u rdnd}|                     |d| dd          }|                     d|           |                     d|           |                     d|           |                     d	|           |                     d
|           |                     d|           |                     d|           |                     d|           |                     d|           |                     |d| dd          }|                     d|           |t          j        u rdnd}|                     d|z   |           |                     d|           |                     |d| dd          }|                     d|           |                     d|           d S )Nr  r  zMethods r  r_   zA_method_alias = A_method(self)zB_method_alias = B_method(self)z7A_staticmethod(x, y) from test.test_pydoc.pydocfodder.Az+A_staticmethod_alias = A_staticmethod(x, y)z2global_func(x, y) from test.test_pydoc.pydocfodderz%global_func_alias = global_func(x, y)zHglobal_func2_alias = global_func2(x, y) from test.test_pydoc.pydocfodderz&__repr__(self, /) from builtins.objectzobject_repr = __repr__(self, /)zStatic methods zRA_classmethod_ref = A_classmethod(x) class method of test.test_pydoc.pydocfodder.Ar&   r  z$B_classmethod_ref = B_classmethod(x)zJA_method_ref = A_method() method of test.test_pydoc.pydocfodder.A instancezClass methods zB_classmethod(x)z&B_classmethod_alias = B_classmethod(x))r3   rA   r   rc   r   r   r  r   r  s          r#   test_html_doc_routines_in_classz/PydocFodderTest.test_html_doc_routines_in_class  s   mooc""6"""%"6"6<N(;5(;(;(;VDD7???7???OQVWWWCUKKKJERRR=uEEE`bghhh>FFF7???(B%(B(B(BFKKjlqrrrKM))rr/_<tCUKKKbdijjj(A(A(A(A6JJ(%000>FFFFFr"   c                 D    |                      t          j                   d S rh   )r  r   Drl  s    r#   )test_text_doc_inherited_routines_in_classz9PydocFodderTest.test_text_doc_inherited_routines_in_class      ,,[];;;;;r"   c                 D    |                      t          j                   d S rh   )r  r   r  rl  s    r#   )test_html_doc_inherited_routines_in_classz9PydocFodderTest.test_html_doc_inherited_routines_in_class  r  r"   c                 @   t          j                    }|                    t                    }t	          |          }|                     |dd          }|                     d|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d	|           |                     d
|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d|           d S )N	FUNCTIONSFILEz)    global_func_alias = global_func(x, y)z    A_staticmethod(x, y)z/    A_staticmethod_alias = A_staticmethod(x, y)z&    A_classmethod(x) class method of Az7    A_classmethod2 = A_classmethod(x) class method of Az7    A_classmethod3 = A_classmethod(x) class method of Bz#    A_method() method of A instancez/    A_method2 = A_method() method of A instancez/    A_method3 = A_method() method of B instancez-    A_staticmethod_ref = A_staticmethod(x, y)z@    A_staticmethod_ref2 = A_staticmethod(y) method of B instancez>    get(key, default=None, /) method of builtins.dict instancezI    dict_get = get(key, default=None, /) method of builtins.dict instancez    B_method(self)z    B_method2 = B_method(self))r3   rS   rB   r   rL   r  r   rn   rE   rx   r/  s       r#    test_text_doc_routines_in_modulez0PydocFodderTest.test_text_doc_routines_in_module  s   moo{++F##V<<A5III0%888GOOO>FFFOQVWWWOQVWWW;UCCCGOOOGOOOEuMMMXZ_```VX]^^^achiii*E2226>>>>>r"   c                 @   t          j                    }|                    t                    }t	          |          }|                     |dd           }|                     d|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d	|           |                     d
|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d|           |                     d|           d S )Nz
 Functionsz& global_func_alias = global_func(x, y)z A_staticmethod(x, y)z, A_staticmethod_alias = A_staticmethod(x, y)z"A_classmethod(x) class method of Az4 A_classmethod2 = A_classmethod(x) class method of Az4 A_classmethod3 = A_classmethod(x) class method of Bz  A_method() method of A instancez, A_method2 = A_method() method of A instancez, A_method3 = A_method() method of B instancez* A_staticmethod_ref = A_staticmethod(x, y)z= A_staticmethod_ref2 = A_staticmethod(y) method of B instancez; get(key, default=None, /) method of builtins.dict instancezF dict_get = get(key, default=None, /) method of builtins.dict instancez B_method(self)z B_method2 = B_method(self))r3   rA   rB   r   rc   r  r   r  s       r#    test_html_doc_routines_in_modulez0PydocFodderTest.test_html_doc_routines_in_module  s   moo{++6""d;;>FFF-u555DeLLL:EBBBLeTTTLeTTT8%@@@DeLLLDeLLLBEJJJUW\]]]SUZ[[[^`efff'///3U;;;;;r"   N)r   r   r    r  r   r   r  r  r  r  r  r  r!   r"   r#   r  r    s        * * * 3>- K K K K8 3>- G G G G4< < << < <? ? ?2< < < < <r"   r  z/Socket server not available on Emscripten/WASI.c                       e Zd Z	 d ZdS )PydocServerTestc           	      d   d }t          j        |dd          |                     j        d            |                     j                   |                     fd           |                     dj                   |                     t                     |                     dt          t          j                            j        d                                                               |                     dt          t          j                            j        d	                                                                                                |                     j                   |                     j                   |                     j                   d S )
Nc                     d| d|d}|S )Nzthe URL sent was: (z, )r!   )rv   content_typerY   s      r#   my_url_handlerz3PydocServerTest.test_server.<locals>.my_url_handler  s     3633EDKr"   	localhostr   )hostnameportc                  >     j         r                                 nd S rh   )servingstop)serverthreads   r#   r  z-PydocServerTest.test_server.<locals>.<lambda>  s     <+?IL%%'''T r"   s$   the URL sent was: (/test, text/html)z/tests'   the URL sent was: (/test.css, text/css)z	/test.css)r3   _start_serverru   errorre  r  r=  r   rv   r   r   r   r   urljoinreadr  r_  rS  	docserver)rn   r  r  s     @r#   test_serverzPydocServerTest.test_server  s   	 	 	 *   
 	+T222,---IIII	 	 	 	k<#3444
###3FL(()97CCDDIIKK	 	 	 	6FL(()9;GGHHMMOO	 	 	
 	-...,0111,*+++++r"   N)r   r   r    r  r!   r"   r#   r  r    s(        
 ( ,  ,  ,  ,  ,r"   r  c                       e Zd Z	 d Zd ZdS )PydocUrlHandlerTestc                     t           j        }|                     t          |dd           |                     t          |dd           d S )Nr   r&   r   foobar)r3   rt   r'  	TypeError)rn   r  s     r#   test_content_type_errz)PydocUrlHandlerTest.test_content_type_err1  sD    )QR000)QX66666r"   c                     g d}|                                  5  |D ]\  }}|                     ||           	 d d d            d S # 1 swxY w Y   d S )N))r&   Pydoc: Index of Modules)zget?key=r   )rJ  r   )topicszPydoc: Topics)keywordszPydoc: Keywords)r3   Pydoc: module pydoc)zget?key=pydocr  )zsearch?key=pydocr  )ztopic?key=defzPydoc: KEYWORD def)ztopic?key=STRINGSzPydoc: TOPIC STRINGS)r  zPydoc: Error - foobar)rr   ry   )rn   requestsrv   r\   s       r#   test_url_requestsz%PydocUrlHandlerTest.test_url_requests6  s       ((** 	2 	2& 2 2
U%%c5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)r   r   r    r  r  r!   r"   r#   r  r  .  s5        &7 7 7
2 2 2 2 2r"   r  c                       e Zd Zd ZdS )
TestHelperc                     |                      t          t          j        j                  t          t
          j                             d S rh   )ru   sortedr3   r   r  keywordkwlistrl  s    r#   test_keywordszTestHelper.test_keywordsN  s@     566//	1 	1 	1 	1 	1r"   N)r   r   r    r  r!   r"   r#   r  r  M  s#        1 1 1 1 1r"   r  c                      e Zd Z ej         eed          o ej                    d          ed                         Z	 ej         eed          o ej                    d          ed                         Z
 ej         eed          o ej                    d          ed                         Z ej         eed          o ej                    d          ed                         Zd ZdS )	PydocWithMetaClassesr~   r   c                     G d dt                     } G d d|          }t          d t          D                       }t                      }t	          j        |          } ||           t          t          f|d d         z   z  }|                                	                                }| 
                    ||           d S )	Nc                        e Zd Z fdZ xZS )=PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Metac                 V    |dk    rdS t                                          |          S )Nhamspamsuper__getattr__rn   r(  ro  s     r#   r  zIPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Meta.__getattr__Y  s)    5==!6ww**4000r"   )r   r   r    r  __classcell__ro  s   @r#   Metar  X  s8        1 1 1 1 1 1 1 1 1r"   r  c                   .    e Zd Zej        d             ZdS );PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DAc                     dS )Neggsr!   rl  s    r#   r  z?PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DA.ham^  s    vr"   N)r   r   r    r  DynamicClassAttributer  r!   r"   r#   DAr  ]  s1        (  )(  r"   r!  	metaclassc              3   (   K   | ]}|rd |z   ndV  dS )z	
 |      r&   Nr!   r(   s     r#   r+   zBPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.<genexpr>a  sO       .I .I*+ CD.KlQ.>.> .I .I .I .I .I .Ir"   r   r  )r   r  expected_data_docstringsr   r3   r   !expected_dynamicattribute_patternr   r   r5   ru   )rn   r  r!  r   rF   r   r   rx   s           r#   test_DynamicClassAttributez/PydocWithMetaClasses.test_DynamicClassAttributeT  s   	1 	1 	1 	1 	14 	1 	1 	1
	 	 	 	 	4 	 	 	 	 ). .I .I/G.I .I .I )I )I%V,,,r


9;BQB??A""((**/////r"   c                 <    G d dt                     } G d d|          }t                      }t          j        |          } ||           t          t
          z  }|                                                                }|                     ||           d S )Nc                   $     e Zd Zd Z fdZ xZS )HPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Metac                 
    g dS )N)ro  r   r   LIFEr!   rf  s    r#   __dir__zPPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__dir__p  s    FFFFr"   c                 V    |dk    rdS t                                          |          S )Nr,  r   )r  _Meta__getattrr  s     r#   r  zTPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__getattr__r  s)    &==2ww((...r"   r   r   r    r.  r  r  r  s   @r#   r  r*  o  sJ        G G G/ / / / / / / / /r"   r  c                       e Zd ZdS )IPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.ClassNr   r!   r"   r#   Classr3  v  r   r"   r4  r"  r   )	r   r   r3   r   "expected_virtualattribute_pattern1r   r   r5   ru   )rn   r  r4  rF   r   r   rx   s          r#   %test_virtualClassAttributeWithOneMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithOneMetak  s    	/ 	/ 	/ 	/ 	/4 	/ 	/ 	/	 	 	 	 	d 	 	 	 	V,,,u:XE""((**/////r"   c                   
  G d dt                     
 G d dt                      G 
fdd
          } G d d
	          } G d
 d||	          }t                      }t          j        |          } ||           t          t
          z  }|                                                                }|                     ||           t                      }t          j        |          } ||           t          t
          z  }|                                                                }	|                     ||	           d S )Nc                   $     e Zd Zd Z fdZ xZS )IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1c                 
    g dS )N)ro  r   r   r   r!   r-  s    r#   r.  zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__dir__      EEEEr"   c                 V    |dk    rdS t                                          |          S )Nr   r   r  r  s     r#   r  zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__getattr__  )    %<<1ww**4000r"   r1  r  s   @r#   Meta1r9    J        F F F1 1 1 1 1 1 1 1 1r"   r>  c                   $     e Zd Zd Z fdZ xZS )IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2c                 
    g dS )N)ro  r   r   twor!   r-  s    r#   r.  zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__dir__  r;  r"   c                 V    |dk    rdS t                                          |          S )NrC  r  r  r  s     r#   r  zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__getattr__  r=  r"   r1  r  s   @r#   Meta2rA    r?  r"   rE  c                   ,     e Zd ZfdZ fdZ xZS )IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3c           
          t          t          t          g d                    |           z                       |           z                                 S )N)ro  r   r   three)r  r	  setr.  )rf  r>  rE  s    r#   r.  zQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__dir__  s^    F3DDDMM#&&').s););<$= $= > > ? ? ?r"   c                 V    |dk    rdS t                                          |          S )NrI  r  r  r  s     r#   r  zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__getattr__  s)    '>>1ww**4000r"   r1  )ro  r>  rE  s   @r#   Meta3rG    sW        ? ? ? ? ? ?1 1 1 1 1 1 1 1 1r"   rL  c                       e Zd ZdS )JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class1Nr   r!   r"   r#   Class1rN    r   r"   rO  r"  c                       e Zd ZdS )JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class2Nr   r!   r"   r#   Class2rQ    r   r"   rR  r   )
r   r   r3   r   "expected_virtualattribute_pattern2r   r   r5   ru   "expected_virtualattribute_pattern3)rn   rL  rO  rR  rF   r   expected_text1result1expected_text2result2r>  rE  s             @@r#   %test_virtualClassAttributeWithTwoMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta  s   	1 	1 	1 	1 	1D 	1 	1 	1	1 	1 	1 	1 	1D 	1 	1 	1	1 	1 	1 	1 	1 	1 	1 	1E5 	1 	1 	1	 	 	 	 	u 	 	 	 		 	 	 	 	Vu 	 	 	 	V,,,v;hF//##))++111V,,,v;hF//##))++11111r"   c                 <    G d dt                     } G d d|          }t                      }t          j        |          } ||           t          t
          z  }|                                                                }|                     ||           d S )Nc                       e Zd Zd ZdS ).PydocWithMetaClasses.test_buggy_dir.<locals>.Mc                 
    g dS )N)ro  r   missingherer!   r-  s    r#   r.  z6PydocWithMetaClasses.test_buggy_dir.<locals>.M.__dir__  s    CCCCr"   N)r   r   r    r.  r!   r"   r#   Mr\    s(        D D D D Dr"   r`  c                       e Zd ZdZdS ).PydocWithMetaClasses.test_buggy_dir.<locals>.Czpresent!N)r   r   r    r_  r!   r"   r#   r  rb    s        DDDr"   r  r"  r   )	r   r   r3   r   !expected_missingattribute_patternr   r   r5   ru   )rn   r`  r  rF   r   r   rx   s          r#   test_buggy_dirz#PydocWithMetaClasses.test_buggy_dir  s    	D 	D 	D 	D 	D 	D 	D 	D	 	 	 	 	! 	 	 	 	V,,,q			9HD""((**/////r"   c                     t                      5 }t          j        d           d d d            n# 1 swxY w Y   |                                }|                     d|           d S )Nz	enum.Enumz
class Enum)r   r3   r   r   r   )rn   r  r  s      r#   test_resolve_falsez'PydocWithMetaClasses.test_resolve_false  s      	$'J{###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$##%%lH-----s   044N)r   r   r    r  r  r  r   r~   r   r'  r6  rY  rd  rf  r!   r"   r#   r  r  S  s       X_WWS*--@,#,..HJ J0 0 J J0( X_WWS*--@,#,..HJ J0 0 J J0" X_WWS*--@,#,..HJ J'2 '2 J J'2R X_WWS*--@,#,..HJ J0 0 J J0. . . . .r"   r  c                   :    e Zd Zd Zd	dZd Zd Zd Zd Zd Z	dS )
TestInternalUtilitiesc                 (   t          j                    }|j        | _        t          j                            |j        d          | _        |                     |j	                   t	          j
                    x| _        }dt          j        |g| _        d S )Nnonexistentr&   )tempfileTemporaryDirectoryr(  argv0dirrO   rP   rL  argv0r=  cleanupgetcwd
abs_curdircurdircurdir_spellings)rn   tmpdirrq  s      r#   r  zTestInternalUtilities.setUp  so    ,..W\\&+}==
'''')y{{2*!#RY
 ;r"   Nc                 >    || j         }t          j        ||          S rh   )rn  r3   _get_revised_path)rn   
given_pathrn  s      r#   rv  z'TestInternalUtilities._get_revised_path  s#     =JE&z5999r"   c                     t           j                                        }| j        D ]<}t	          |                    |                    D ]}|                    |           =|S rh   )r   rP   copyrs  rv  countrf  )rn   
clean_pathspelling__s       r#   _get_starting_pathz(TestInternalUtilities._get_starting_path  sj    X]]__
- 	, 	,HJ,,X6677 , ,!!(++++,r"   c                     |                                  }| j        g|z   }|                     |                     |          |           d S rh   )r~  rq  ru   rv  )rn   r{  expected_paths      r#   ,test_sys_path_adjustment_adds_missing_curdirzBTestInternalUtilities.test_sys_path_adjustment_adds_missing_curdir  sL    ,,..
)J6//
;;]KKKKKr"   c                    |                                  }| j        g|z   }| j        g|z   }|                     |                     |          |           || j        gz   }|                     |                     |          |           d S rh   )r~  rq  rm  ru   rv  )rn   r{  r  leading_argv0dirtrailing_argv0dirs        r#   *test_sys_path_adjustment_removes_argv0_dirz@TestInternalUtilities.test_sys_path_adjustment_removes_argv0_dir  s    ,,..
)J6 M?Z7//0@AA=QQQ&$-8//0ABBMRRRRRr"   c                      fd}                                  } j        g|z   } j        g|z   }                      ||          |           | j        gz   } j        g|z   }                      ||          |           d S )Nc                 F                         | t          j                  S )N)rn  )rv  r3   r4   )rw  rn   s    r#   rv  z\TestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir.<locals>._get_revised_path  s    ))*EN)KKKr"   )r~  rm  rq  ru   )rn   rv  r{  r  r  r  s   `     r#   +test_sys_path_adjustment_protects_pydoc_dirzATestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir  s    	L 	L 	L 	L 	L,,..
 M?Z7),<<**+;<<mLLL&$-8),==**+<==}MMMMMr"   c                 "   |                                  }| j        D ]}|                     |          5  |g|z   }|                     |                     |                     ||gz   }|                     |                     |                     | j        g|z   }|                     |                     |                     || j        gz   }|                     |                     |                     d d d            n# 1 swxY w Y   d S )N)curdir_spelling)r~  rs  subTestrS  rv  rm  )rn   r{  r|  leading_curdirtrailing_curdirr  r  s          r#   5test_sys_path_adjustment_when_curdir_already_includedzKTestInternalUtilities.test_sys_path_adjustment_when_curdir_already_included  sn   ,,..
- 
	M 
	MHh77 	M 	M"*j!8!!$"8"8"H"HIII",z"9!!$"8"8"I"IJJJ$(M?^#C !!$"8"89I"J"JKKK$3t}o$E!!!$"8"89J"K"KLLL	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M
	M 
	Ms   CDD	
D	rh   )
r   r   r    r  rv  r~  r  r  r  r  r!   r"   r#   rh  rh    s        < < <: : : :  L L L
S S S	N 	N 	NM M M M Mr"   rh  c                      t          j                    } t          j        t           j        g| R   t          j        t
                     d S rh   )r   threading_setupr  addModuleCleanupthreading_cleanupr   )thread_infos    r#   setUpModuler    sD    "244K.@O;OOOOm,,,,,r"   __main__)`rO   r   rz   importlib.utilrM  r   r3   rQ  r
  r8  rq   rJ   r  rk  test.supporttestr  r  r  urllib.parser   	xml.etreer   xml.etree.ElementTreer  ior   collectionsr   urllib.requestr   r   r   r   r	   test.support.script_helperr
   r   r   r   r   r   r   r   r   r   r   r   test.support.os_helperr   r   r   test.test_pydocr   r   r   HAVE_DOCSTRINGSr%  r5   r   r  r   r   expected_html_data_docstringsr/   r   r   r  r&  r5  rS  rT  rc  r=   r?   rH   rL   rT   rV   r]   rc   TestCasere   r}   r  r  r  r  r  r  r  r  rh  r  r   mainr!   r"   r#   <module>r     s   				 



                  				                             " " " " " " . . . . . . . .       & & & & & & " " " " " "M M M M M M M M M M ) ) ) ) ) )E E E E E E E E E E E E E E E E E E E E < ; ; ; ; ; ; ; ; ; % % % % % % ' ' ' ' ' '	 	 	 	 	 	 	 	 < 0 
  0\x 
EGGy | !& &I &I/G&I &I &I !I !I M ^ !& &I &I/G&I &I &I !I !I , -4GD"*,E,E  N %  
EGG! "$& 
EGG #& 
EGG #&, 
EGG- #0% 
EGG "      " " "  	 	 	  	 	 	    H%   <z3 z3 z3 z3 z38$ z3 z3 z3zX@ X@ X@ X@ X@m X@ X@ X@vV
 V
 V
 V
 V
x( V
 V
 V
r
w< w< w< w< w<h' w< w< w<t W5 #, #, #, #, #,h' #, #,	 #,L2 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HMOOOOO r"   