asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T a bYh@sddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlm Z ddlm!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)ddlm*Z*GdddZ+ej,j-r2d Z.nd Z.d /Z0e1d d e.DZ2d/Z3e1dd e.DZ4d5dej6Z7dZ8d/Z9d/Z:d/Z;d/ZddZ?ddZ@ddZAd d!ZBGd"d#d#ejCZDGd$d%d%ejCZEGd&d'd'eDZFGd(d)d)ejCZGGd*d+d+ejCZHGd,d-d-eDZIGd.d/d/ejCZJGd0d1d1ejCZKGd2d3d3ejCZLd4d5ZMeNd6kreOdS)7N)StringIO) namedtuple)assert_python_ok) TESTFNrmtree reap_children reap_threadscaptured_outputcaptured_stdoutcaptured_stderrunlinkrequires_docstrings) pydoc_modc@seZdZdZdS)nonasciiuЦе не латиницяN__name__ __module__ __qualname____doc__rr+/usr/local/lib/python3.9/test/test_pydoc.pyr#sr).dictionary for instance variables (if defined)2list of weak references to the object (if defined)rr)rrra NAME test.pydoc_mod - This is a test module for test_pydoc %s CLASSES builtins.object A B C class A(builtins.object) | Hello and goodbye | | Methods defined here: | | __init__() | Wow, I have no function! | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__%s | | __weakref__%s class B(builtins.object) | Data descriptors defined here: | | __dict__%s | | __weakref__%s | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | NO_MEANING = 'eggs' | | __annotations__ = {'NO_MEANING': } class C(builtins.object) | Methods defined here: | | get_answer(self) | Return say_no() | | is_it_true(self) | Return self.get_answer() | | say_no(self) | | ---------------------------------------------------------------------- | Class methods defined here: | | __class_getitem__(item) from builtins.type | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) FUNCTIONS doc_func() This function solves all of the world's problems: hunger lack of Python war nodoc_func() DATA __xyz__ = 'X, Y and Z' c_alias = test.pydoc_mod.C[int] list_alias1 = typing.List[int] list_alias2 = list[int] type_union1 = typing.Union[int, str] VERSION 1.2.3.4 AUTHOR Benjamin Peterson CREDITS Nobody FILE %s ccs|]}|rd|ndVqdS)z | rNr.0srrr srak
 
 
test.pydoc_mod (version 1.2.3.4)
index
%s%s

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__
%s
__weakref__
%s

 
class B(builtins.object)
     Data descriptors defined here:
__dict__
%s
__weakref__
%s

Data and other attributes defined here:
NO_MEANING = 'eggs'
__annotations__ = {'NO_MEANING': <class 'str'>}

 
class C(builtins.object)
     Methods defined here:
get_answer(self)
Return say_no()
is_it_true(self)
Return self.get_answer()
say_no(self)

Class methods defined here:
__class_getitem__(item) from builtins.type

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

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

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

 
Author
        Benjamin Peterson

 
Credits
        Nobody
ccs|]}|ddVqdS) z N)replacerrrrrsz~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!' cOs2||f}tdtjg|Ri|\}}}|S)zW Runs pydoc on the specified module. Returns the stripped output of pydoc. z-B)rpydoc__file__strip) module_nameargsenvrcouterrrrr run_pydocls  r*cCs<t}||}|tpd}|r0d|d}||fS)z&Returns pydoc generated output as htmlrz
Module Docs)r!HTMLDoc docmodule getdoclocrr#)moduledocoutputlocrrrget_pydoc_htmlvs   r2cCs:tjj}tjj}|||t}t}|j||d}|S)z,Returns a documentation web link of a module)basedir)ospathabspathdirnamer"r!TextDocr-)r.r6r7r3r/r1rrrget_pydoc_links r9cCsRt}|tpd}|r&d|d}||}td}|d|}||fS)z&Returns pydoc generated output as textrz MODULE DOCS r .) r!r8r-rr,recompilesubr#)r.r/r1r0Zpattrrrget_pydoc_texts    r>cCs4|d\}}}|d\}}}|d\}}}|S)Nzzz) partition)textheader_titlerrrget_html_titlesrDc@s.eZdZdddZejd ddZddZdS) PydocBaseTestNcs&|ptjtgdfdd }|S)zi A version of pkgutil.walk_packages() that will restrict itself to a given path. Nrcs|p||SNr)r5prefixonerrorZ default_path walk_packagesrrwrappersz8PydocBaseTest._restricted_walk_packages..wrapper)NrN)r4r5r7r")selfrJr5rKrrIr_restricted_walk_packagessz'PydocBaseTest._restricted_walk_packagesccs2tj}|||t_zdVW|t_n|t_0dSrF)pkgutilrJrM)rLr5rJrrrrestrict_walk_packagessz$PydocBaseTest.restrict_walk_packagescCs&t|d}t|}|||||S)Nz text/html)r! _url_handlerrD assertEqual)rLurlZexpected_titler@resultrrrcall_url_handlers zPydocBaseTest.call_url_handler)N)N)rrrrM contextlibcontextmanagerrOrTrrrrrEs  rEc@seZdZdZeejjdkdee edo2e de ddZ eejjdkdee edole de dd Z d d Zd d ZddZddZddZddZeejjdkdddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zeejjdkdee edo,e de d'd(Zd)d*Zd+d,Zd-d.Zeejjdkdd/d0Z d1d2Z!d3d4Z"d5d6Z#d7d8Z$d9d:Z%d;d<Z&dS)= PydocDocTestN)Docstrings are omitted with -O2 and abovegettrace1trace function introduces __locals__ unexpectedlycCsDtt\}}tt}tj|}t|||ft}| ||dSrF) r2rinspect getabsfileurllibparsequoteexpected_html_patternexpected_html_data_docstringsrQ)rLrSdoc_locZmod_fileZmod_urlZ expected_htmlrrr test_html_docs   zPydocDocTest.test_html_doccCs6tt\}}t|ftttf}|||dSrF)r>rexpected_text_patternexpected_text_data_docstringsr\r]rQ)rLrSrc expected_textrrr test_text_docs  zPydocDocTest.test_text_doccCs4ddl}Gddd|j}t|}|d|dS)Nrc@seZdZdZdZdS)zIPydocDocTest.test_text_enum_member_with_value_zero..BinaryIntegerrN)rrrZzeroonerrrr BinaryIntegersrkz)enumIntEnumr! render_docassertIn)rLrlrkr/rrr%test_text_enum_member_with_value_zeros z2PydocDocTest.test_text_enum_member_with_value_zerocCsttjj}|d|dS)Nzxml.etree.elementtree)r9xmletreeZ ElementTreero)rLZdoc_linkrrr,test_mixed_case_module_names_are_lower_caseds z9PydocDocTest.test_mixed_case_module_names_are_lower_casedcCs ttj\}}||dddS)Nrz'MODULE DOCS incorrectly includes a link)r>rqrrrQ)rLrSrcrrrtest_issue8225szPydocDocTest.test_issue8225cCs,tj}zdt_tW|t_n|t_0dSrF)sysstdinr!getpager)rLZprevious_stdinrrrtest_getpager_with_stdin_nones  z*PydocDocTest.test_getpager_with_stdin_nonecCsLGddd}Gddd}t|}t|}||dd|dS)Nc@seZdZdZdS)z)PydocDocTest.test_non_str_name..A*NrrrrrrrAsr{c@s eZdZdS)z)PydocDocTest.test_non_str_name..BNrzrrrrBsr|)r!rnrQr)rLr{r|ZadocZbdocrrrtest_non_str_names   zPydocDocTest.test_non_str_namecCs,d}tt|d}t|}|||ddS)Ntest.i_am_not_hereasciiz&documentation for missing module found)strr*missing_patternrQrLZmissing_modulerSexpectedrrr test_not_heres zPydocDocTest.test_not_herez)Docstrings are omitted with -OO and abovecCs*tddd}tjdd}|||dS)Nztest.test_pydoc.nonasciir)ZPYTHONIOENCODINGbackslashreplace)r*rrencodero)rLrSencodedrrrtest_not_ascii s zPydocDocTest.test_not_asciicCs.d}tt|d}t|}|||dS)Nz test.i_am_not_here r)rr*rr#rQrrrrtest_input_strips zPydocDocTest.test_input_stripcCsJtj}||dd||dd||dd||dddS)Nzzz Z42z)r!stripidrQ)rLrrrr test_stripids   zPydocDocTest.test_stripidcCs&t}|t}d}|||dS)aTests help on builtin object which have more than four child classes. When running help() on a builtin class which has child classes, it should contain a "Built-in subclasses" section and only 4 classes should be displayed with a hint on how many more subclasses are present. For example: >>> help(object) Help on class object in module builtins: class object | The most base type | | Built-in subclasses: | async_generator | BaseException | builtin_function_or_method | bytearray | ... and 82 other subclasses z | Built-in subclasses: | async_generator | BaseException | builtin_function_or_method | bytearray | ... and \d+ other subclassesN)r!r8docclassobjectZ assertRegexrLr/r@Zsniprrr)test_builtin_with_more_than_four_children#s z6PydocDocTest.test_builtin_with_more_than_four_childrencCs&t}|t}d}|||dS)a1Tests help on builtin object which have only child classes. When running help() on a builtin class which has child classes, it should contain a "Built-in subclasses" section. For example: >>> help(ArithmeticError) Help on class ArithmeticError in module builtins: class ArithmeticError(Exception) | Base class for arithmetic errors. | ... | | Built-in subclasses: | FloatingPointError | OverflowError | ZeroDivisionError zc | Built-in subclasses: | FloatingPointError | OverflowError | ZeroDivisionErrorN)r!r8rArithmeticErrorrorrrrtest_builtin_with_childBs z$PydocDocTest.test_builtin_with_childcCs2t}|t}d}||||d|dS)aTests help on builtin classes which have grandchild classes. When running help() on a builtin class which has child classes, it should contain a "Built-in subclasses" section. However, if it also has grandchildren, these should not show up on the subclasses section. For example: >>> help(Exception) Help on class Exception in module builtins: class Exception(BaseException) | Common base class for all non-exit exceptions. | ... | | Built-in subclasses: | ArithmeticError | AssertionError | AttributeError ... z^ | Built-in subclasses: | ArithmeticError | AssertionError | AttributeErrorZeroDivisionErrorN)r!r8r Exceptionro assertNotInrrrrtest_builtin_with_grandchild]s   z)PydocDocTest.test_builtin_with_grandchildcCs"t}|t}|d|dS)aTests help on builtin object which have no child classes. When running help() on a builtin class which has no child classes, it should not contain any "Built-in subclasses" section. For example: >>> help(ZeroDivisionError) Help on class ZeroDivisionError in module builtins: class ZeroDivisionError(ArithmeticError) | Second argument to a division or modulo operation was zero. | | Method resolution order: | ZeroDivisionError | ArithmeticError | Exception | BaseException | object | | Methods defined here: ... Built-in subclassesN)r!r8rrrrLr/r@rrrtest_builtin_no_child}s z"PydocDocTest.test_builtin_no_childcCs"t}|t}|d|dS)zTests help on metaclasses. When running help() on a metaclasses such as type, it should not contain any "Built-in subclasses" section. rN)r!r8rtyperrrrrtest_builtin_on_metaclassess z(PydocDocTest.test_builtin_on_metaclassesc Cst}tj}dd}d|_t}tj|d}tt\}}d}d} t | } | t} |t_zt d} t dl} | || } | |ftttf}|d| |d| ||| Wdn1s0YWdn1s0YW|t_n|t_0dS) NcSsddS)NcSs|SrFr)xrrrzJPydocDocTest.test_help_output_redirect....rrrrrrrz8PydocDocTest.test_help_output_redirect..r0ztest.pydoc_modz9 Help on module test.pydoc_mod in test: stdoutstderrr)rer!rwmaxDiffrHelperr>rlstriptextwrapdedentr helpgetvaluer#rfr\r]rQ)rLZ old_patternZ getpager_oldZ getpager_newbufhelperZunusedrcr.Z help_headerZexpected_help_patternr0r)rSrgrrrtest_help_output_redirects<       Jz&PydocDocTest.test_help_output_redirectcCsztdddg}t}t|Wdn1s40Y|}|d||d||d||d|dS)NPersonnickname firstnamezAlias for field number 0zAlias for field number 1rr r!rrro)rLrhelp_iohelptextrrrtest_namedtuple_fieldss(   z#PydocDocTest.test_namedtuple_fieldscCsrtdddgdd}t}t|Wdn1s80Y|}|d||d||d|dS) NNTabcdefT)renameZ_1_replace_asdictr)rLrrrrrr!test_namedtuple_public_underscores(  z.PydocDocTest.test_namedtuple_public_underscorec Cs|ttdD]|}ttd|dB}|dkr>td||dtd|dtd|dWdn1sj0Ytti}||d qdS) N)z ISO-8859-1UTF-8wencodingrz #coding: {})fileu"""line 1: héz line 2: hi"""u line 1: hé) addCleanupr ropenprintformatr!synopsisrQ)rLrZscriptrrrr test_synopsiss  * zPydocDocTest.test_synopsiscCs.tjd}tj}t|}|||dS)Nr)r4r splitlines __cached__r!rrQ)rLrfilenamerrrrtest_synopsis_sourcelesss z%PydocDocTest.test_synopsis_sourcelessc Cstj}tj|d}tj|}t |d}| dWdn1sP0Yt |t |i}||t |i}||Wdn1s0YdS)Nz foomod42.pyrfoo = 1)testsupporttemp_cwdr4r5join importlibutilcache_from_sourcerwrite py_compiler<r!r assertIsNone)rLtest_dir init_pathZ cached_pathfobjrZsynopsis_cachedrrr"test_synopsis_sourceless_empty_docs   (    z/PydocDocTest.test_synopsis_sourceless_empty_doccCsd}|t|ddS)Nz#I Am A Doc Here is my description)z I Am A Docz Here is my description)rQr!Zsplitdoc)rLZexample_stringrrrtest_splitdoc_with_descriptions z+PydocDocTest.test_splitdoc_with_descriptioncCs>tj }|t|Wdn1s00YdSrF)rrrZ assertFalser! ispackage)rLrrrr test_is_package_when_not_packages z-PydocDocTest.test_is_package_when_not_packagecCsdtjF}tj|d}t|d|t |t |Wdn1sV0YdS)N __init__.pyr) rrrr4r5rrclose assertTruer!rremove)rLrrrrrtest_is_package_when_is_packages  z,PydocDocTest.test_is_package_when_is_packagecCs`Gdddt}ttt}|j|d<|d=|d=|j|d<|j|d<t|}|||dS)Nc@seZdZddZdS)z/PydocDocTest.test_allmethods..TestClasscSsdS)NTrrLrrrmethod_returning_trueszEPydocDocTest.test_allmethods..TestClass.method_returning_trueN)rrrrrrrr TestClasssrrr __class____subclasshook____init_subclass__) rdictvarsrrrr!Z allmethodsZassertDictEqual)rLrrmethodsrrrtest_allmethodss     zPydocDocTest.test_allmethodscspGdddGfddd}t|}tdd|}||dttj|td}||d tdS) Nc@s"eZdZdddZeZddZdS)z+PydocDocTest.test_method_aliases..ANcSsdS)z(Raise this widget in the stacking order.Nr)rLZ aboveThisrrrtkraise*sz3PydocDocTest.test_method_aliases..A.tkraisecSsdS)z Return sizeNrrrrra_size-sz2PydocDocTest.test_method_aliases..A.a_size)N)rrrrZliftrrrrrr{)s r{cs eZdZdddZeZjZdS)z+PydocDocTest.test_method_aliases..BNc[sdS)z'Configure resources of an item TAGORID.Nr)rLZtagOrIdZcnfkwrrr itemconfigure0sz9PydocDocTest.test_method_aliases..B.itemconfigure)N)rrrrZ itemconfigrZb_sizerr{rrr|/s r|r:raPython Library Documentation: class B in module %s class B(A) | Method resolution order: | B | A | builtins.object | | Methods defined here: | | b_size = a_size(self) | | itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw) | | itemconfigure(self, tagOrId, cnf=None, **kw) | Configure resources of an item TAGORID. | | ---------------------------------------------------------------------- | Methods inherited from A: | | a_size(self) | Return size | | lift = tkraise(self, aboveThis=None) | | tkraise(self, aboveThis=None) | Raise this widget in the stacking order. | | ---------------------------------------------------------------------- | Data descriptors inherited from A: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) ZrendereraPython Library Documentation: class B in module %s

 
class B(A)
    
Method resolution order:
B
A
builtins.object

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

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

Data descriptors inherited from A:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
)r!rnr;r=rQrr+)rLr|r/rrrtest_method_aliases(s %'(z PydocDocTest.test_method_aliases)'rrrrunittestskipIfruflagsoptimizehasattrrZr rdrhrprsrtrxr}rrrrrrrrrrrrrrrrrrrrrrrrrWsn       #     rWc@szeZdZddZddZddZddZd d Zd d Ze d ddZ e d ddZ e dddZ ddZdS)PydocImportTestcCs$tt|_|tttdSrF)r4mkdirrrrrrinvalidate_cachesrrrrsetUps  zPydocImportTest.setUpc Csd}dddd|dfd|d|ff}tjt|tjd}|D]l\}}t|d  }|d |Wdn1s0Yt|td  d }t ||f}| ||qHdS) NZ testmod_xyzzy) i_am_not_herer)test.i_am_not_here_eitherr)ztest.i_am_not_here.neither_am_ir~zi_am_not_here.{}rztest.{}pyrz import {} )Z PYTHONPATHr) rr4r5rrextseprrr*decodebadimport_patternrQ) rLmodnameZ testpairsZsourcefnZ importstringZ expectedinmsgfrSrrrrtest_badimports   . zPydocImportTest.test_badimportc Cstjtd}t|tj|dtjd}t|d}|dWdn1sZ0Y|jtgdt @}t }t dWdn1s0YWdn1s0Y| |d| |dt B}t }t dWdn1s0YWdn1s<0Y| |d| |dWdn1s0YdS) NZ syntaxerr__init__rrzinvalid python syntax = $1 r5Zxyzzyr)r4r5rrrrrrrOr r r!aproposrQrr#)rLpkgdirZ badsyntaxrr(r)rrrtest_apropos_with_bad_packages   (FJz-PydocImportTest.test_apropos_with_bad_packagec Cstjtd|_t|jd|tj|j|jtgdft @}t }t dWdn1sl0YWdn1s0YWdn1s0Y| |d| |ddS)NZ unreadablerrZSOMEKEYr)r4r5rrZunreadable_dirrrrmdirrOr r r!rrQr)rLr(r)rrr test_apropos_with_unreadable_dirsdz0PydocImportTest.test_apropos_with_unreadable_dirc Cstjtd}t||t|tj|d}t|d}|dWdn1s\0Yt t |j }zt ||t j @|jtgd@t}tdWdn1s0YWdn1s0Y|d|Wt ||nt ||0dS)NZwalkpkgrrrrr)r4r5rrrrrrrstatS_IMODEst_modechmodS_IEXECrOr r!rror)rLrrrZ current_moderrrrtest_apropos_empty_docs   (Fz&PydocImportTest.test_apropos_empty_docc Cstjtd}t|tj|d}t|ddd}|dWdn1sT0Y|jtgdtt j}t j dtzb| t d ddl }Wdn1s0Y|d d }d }|||W|t jdd<n|t jdd<0Wdn1s0YdS) Ntest_error_packagerZwtrrzraise ValueError("ouch") rrZouchzsearch?key=test_error_packagePydoc: Search Resultsz8test_error_package)r4r5rrrrrrOtupleruinsertZassertRaisesRegex ValueErrorrrTro)rLrinitrZ saved_pathsrr@foundrrrtest_url_search_package_errors" ( &z-PydocImportTest.test_url_search_package_errorz(causes undesirable side-effects (#20128)c CsZd}d}d}|||}t}tj|d}|d|}t|}|||dS)NrXrmodules)rr!rrr#lenrZassertGreaterEqual) rLZnum_header_linesZnum_module_lines_minZnum_footer_linesrr0rrSZ num_linesrrr test_moduless    zPydocImportTest.test_modulescCs\d}t}tj|d}t}|dWdn1s:0Y|}|||dS)Nzpydoc - rz modules pydoc)rr!rr rrorLrr0rrrSrrrtest_modules_searchs &z#PydocImportTest.test_modules_searchz+some buildbots are not cooperating (#20128)cCs`d}t}tj|d}t}|dWdn1s:0Y|}|||dS)Nzgc - rzmodules garbage)rr!rr rr startswithrrrrtest_modules_search_builtins &z+PydocImportTest.test_modules_search_builtincCsJttj}||t||jd||jtj||jtjdS)Nr!)r!Z importfiler"Z assertIsNotrQr__spec__)rLZ loaded_pydocrrrtest_importfiles   zPydocImportTest.test_importfileN)rrrrrrrrrrskiprrrr!rrrrrs   rc@s4eZdZddZddZddZddZd d Zd d Zd dZ e ddZ e ddZ ddZ eddZddZddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zed/d0Zed1d2Zed3d4Zd5d6Zd7d8Z d9d:Z!d;S)<TestDescriptionscCs&ddlm}t|}|d|dS)Nr) pydocfodderr$)rr$r!rnro)rLr$r/rrr test_module&s  zTestDescriptions.test_modulecCsVGddd}|}|t|d|t|ddt}||t|dS)Nc@seZdZdZdS)z&TestDescriptions.test_class..CzNew-style classNrrrrrC-rr&zclass CzC in module %s object)rQr!describerrorn)rLr&crrrr test_class,s zTestDescriptions.test_classcCs|ttjtdtjtjttjd}|d||d||t j d||tt tdtjt ttjd}|d||d||t j d|dS)N _GenericAliasrz_GenericAlias in module typingz class list(object)r GenericAliaszGenericAlias in module builtins) rQr!r'typingListintrn plaintextrolistrr#rrLr/rrrtest_generic_alias5s    z#TestDescriptions.test_generic_aliascCsv|ttjttfdtjtjttftjd}| d|| d|tjj rr| tjj d|dS)N_UnionGenericAliasrz#_UnionGenericAlias in module typingz typing.Unionr) rQr!r'r,Unionr.rrnr/rorr#rr1rrrtest_union_typeBs   z TestDescriptions.test_union_typecCst|ttjdtjtjtjd}|d|tjjrd|d||tjj d|n |d|dS)N _SpecialFormrz_SpecialForm in module typingz typing.Anyrz class _SpecialForm(_Final)) rQr!r'r,Anyrnr/rorr#rr1rrrtest_special_formJs  z"TestDescriptions.test_special_formcCstjtjttjtjttjfddd}td}Gdddtj|tjtt f}| t | dd| t | d d dS) N)datarreturncSsdSrFr)r9rrrrfooUsz/TestDescriptions.test_typing_pydoc..fooTc@s eZdZdS)z-TestDescriptions.test_typing_pydoc..CNrzrrrrr&Yrr&z?ffoooo(data: List[Any], x: int) -> Iterator[Tuple[int, Any]]rXz2class CC(collections.abc.Mapping, typing.Generic))r,r-r7r.IteratorTupleTypeVarGenericMappingrrQr!rnr)rLr;r<r&rrrtest_typing_pydocTs   "z"TestDescriptions.test_typing_pydocc CszdD]F}|t|zt|WqtyH|d|Yq0qdD]$}|t||ttj|qPdS)N)rz str.translatez builtins.strzbuiltins.str.translatezfinding the doc of {!r} failed)Z notbuiltinsZstrrrzstrr.translatezstr.trrrranslatezbuiltins.strrrzbuiltins.str.trrranslate) ZassertIsNotNoner!Zlocatern ImportErrorZfailrr assertRaisesrLnamerrr test_builtin`s zTestDescriptions.test_builtincCs2tt|}|d}t|dks*J|dSNr rX)r!plainrnsplitror@linesrrr_get_summary_lineqs z"TestDescriptions._get_summary_linecCs,tt|}|d}d|ddSrI)r!rJrnrKrrLrrr_get_summary_linesxs z#TestDescriptions._get_summary_linescCs||tjjddS)Nzwrap(self, text))rQrOr TextWrapperwraprrrrtest_unbound_python_methodsz+TestDescriptions.test_unbound_python_methodcCs||tjjddS)Nzdump(self, obj, /))rQrO_picklePicklerdumprrrrtest_unbound_builtin_methodsz,TestDescriptions.test_unbound_builtin_methodcCs t}|||jddS)Nz2wrap(text) method of textwrap.TextWrapper instance)rrQrQrOrR)rLtrrrtest_bound_python_methodsz)TestDescriptions.test_bound_python_methodcCs|tdgd}t|}||d|d||d|dGddd}Gdd d }t|t|dS) Nr)rragegrouprrrZc@seZdZdZdS)zMTestDescriptions.test_field_order_for_named_tuples..NonIterableFieldsNrrr_fieldsrrrrNonIterableFieldssr]c@seZdZggZdS)zMTestDescriptions.test_field_order_for_named_tuples..NonHashableFieldsNr[rrrrNonHashableFieldssr^)rr!rnZ assertLessindex)rLrrr]r^rrr!test_field_order_for_named_tupless  z2TestDescriptions.test_field_order_for_named_tuplescCs(t}t|}|||jddS)Nz/dump(obj, /) method of _pickle.Pickler instance)rrTrUrQrOrV)rLrprrrtest_bound_builtin_methods  z*TestDescriptions.test_bound_builtin_methodcCs||tjddS)Nz0stat(path, *, dir_fd=None, follow_symlinks=True))rQrOr4r rrrrtest_module_level_callablesz+TestDescriptions.test_module_level_callablecCsVGddd}|||jdd|||jd|dtt|dS)Nc@seZdZeddZdS)z-TestDescriptions.test_staticmethod..XcSsdS)zA static methodNrryrrrsmsz0TestDescriptions.test_staticmethod..X.smN)rrr staticmethodrfrrrrXsrhrfzzsm(x, y) A static method zL | Static methods defined here: | | sm(x, y) | A static method )rQrP__dict__rfror!rJrnrLrhrrrtest_staticmethodsz"TestDescriptions.test_staticmethodcCsVGddd}|||jdd|||jd|dtt|dS)Nc@seZdZeddZdS)z,TestDescriptions.test_classmethod..XcSsdS)zA class methodNr)clsrrrrcmsz/TestDescriptions.test_classmethod..X.cmN)rrr classmethodrmrrrrrhsrhrmzz:cm(x) method of builtins.type instance A class method zZ | Class methods defined here: | | cm(x) from builtins.type | A class method )rQrPrirmror!rJrnrjrrrtest_classmethodsz!TestDescriptions.test_classmethodcCsT||tjd||tjd||tjd||tj ddS)N numeratorrealr%obj) rQrOr.rpfloatrqrr% memoryviewrrrrrrtest_getset_descriptorsz'TestDescriptions.test_getset_descriptorcCsh||tjd||tjd||tjd||tjd||t j ddS)Nrqstartfgetvalue) rQrOcomplexrqrangervslicepropertyrw StopIterationrxrrrrtest_member_descriptors z'TestDescriptions.test_member_descriptorcCs&Gddd}|||jddS)Nc@seZdZdZdS)z4TestDescriptions.test_slot_descriptor..PointrdN)rrr __slots__rrrrPointsrr)rQrOr)rLrrrrtest_slot_descriptorsz%TestDescriptions.test_slot_descriptorcCs*Gddd}|||jdddS)Nc@s eZdZdS)z6TestDescriptions.test_dict_attr_descriptor..NSNrzrrrrNSsrri)rQrOri)rLrrrrtest_dict_attr_descriptorsz*TestDescriptions.test_dict_attr_descriptorcCsl||ttjjd||ttjjd||ttjj d||ttj j ddS)Nwidthdebugmajormax) rQrOrru hash_inforrr version_infor float_inforrrrr test_structseq_member_descriptorsz1TestDescriptions.test_structseq_member_descriptorcCs"tdd}|||jddS)NBox)rZheightz Alias for field number 0 )rrQrPr)rLrrrr test_namedtuple_field_descriptors z1TestDescriptions.test_namedtuple_field_descriptorcCs>Gddd}|||jd|dtt|dS)Nc@seZdZeddZdS)z,TestDescriptions.test_property..RectcSs |j|jS)zArea of the rect)rhrrrrareasz1TestDescriptions.test_property..Rect.areaN)rrrr|rrrrrRectsrz Area of the rect z# | area | Area of the rect )rQrPrror!rJrn)rLrrrr test_propertys zTestDescriptions.test_propertycspGdddGfddd}|||jdd|j_|||jdd|j_|||jd dS) Nc@seZdZddZdS)z?TestDescriptions.test_custom_non_data_descriptor..DescrcSs|dur |SdSNryrrLrrrlrrr__get__szGTestDescriptions.test_custom_non_data_descriptor..Descr.__get__N)rrrrrrrrDescrsrcseZdZZdS)z;TestDescriptions.test_custom_non_data_descriptor..XNrrrattrrrrrrhsrhzX.Descr object>Custom descriptorzo.Descr object> Custom descriptor r;zfoo(...) Custom descriptor rQrPrrrrjrrrtest_custom_non_data_descriptorsz0TestDescriptions.test_custom_non_data_descriptorcspGdddGfddd}|||jdd|j_|||jdd|j_|||jd dS) Nc@seZdZddZddZdS)z;TestDescriptions.test_custom_data_descriptor..DescrcSs|dur |SdSrrrrrrr0szCTestDescriptions.test_custom_data_descriptor..Descr.__get__cSs dddS)Nrirrrrrr__set__4szCTestDescriptions.test_custom_data_descriptor..Descr.__set__N)rrrrrrrrrr/srcseZdZZdS)z7TestDescriptions.test_custom_data_descriptor..XNrrrrrrh6srhrrz Custom descriptor r;zfoo Custom descriptor rrjrrrtest_custom_data_descriptor-sz,TestDescriptions.test_custom_data_descriptorcCsJtddd}ttj|}|d|t|}|d|dS)N)r:csdSNrir)Zignrrr coro_functionGsz=TestDescriptions.test_async_annotation..coro_functionzasync coro_functionz4async coro_function)r.r!rJr/documentror+)rLrr@htmlrrrtest_async_annotationFs z&TestDescriptions.test_async_annotationcCsDdd}ttj|}|d|t|}|d|dS)NcSs dVdSrrrrrran_async_generatorSszLTestDescriptions.test_async_generator_annotation..an_async_generatorzasync an_async_generatorz>async an_async_generator)r!rJr/rror+)rLrr@rrrrtest_async_generator_annotationRs z0TestDescriptions.test_async_generator_annotationcCs&dd}t|}|d|dS)NcSsdS)za link https://localhost/Nrrrrra_fn_with_https_link_szHTestDescriptions.test_html_for_https_links..a_fn_with_https_linkz3https://localhost/)r!r+rro)rLrrrrrtest_html_for_https_links^s z*TestDescriptions.test_html_for_https_linksN)"rrrr%r)r2r5r8rCrHrgrOrPrSr rWrYr`rbrcrkrorur~rrrrrrrrrrrrrrr#$sZ                      r#c@seZdZdZddZdS)PydocServerTestzTests for pydoc._start_servercCs|dd}tj|ddd}|d|jjt}tjj }|j rjt d|j r8t||kr8| qjq8| |jddS)NcSsd||f}|S)Nzthe URL sent was: (%s, %s)r)rRZ content_typer@rrrmy_url_handleros z3PydocServerTest.test_server..my_url_handlerz0.0.0.0r)hostnameportg{Gz?)r!Z _start_serverroZ docserveraddresstime monotonicrrZ SHORT_TIMEOUTZservingsleepstoprQerror)rLrZ serverthreadZ starttimetimeoutrrr test_serverls zPydocServerTest.test_serverN)rrrrrrrrrrisrc@s eZdZdZddZddZdS)PydocUrlHandlerTestzTests for pydoc._url_handlercCs*tj}|t|dd|t|dddS)Nr{rr|foobar)r!rPrE TypeError)rLrrrrtest_content_type_errsz)PydocUrlHandlerTest.test_content_type_errcCsNgd}|*|D]\}}|||qWdn1s@0YdS)N) )rPydoc: Index of Modules)zget?key=r)r_r)Ztopicsz Pydoc: Topics)keywordszPydoc: Keywords)r!Pydoc: module pydoc)z get?key=pydocr)zsearch?key=pydocr)z topic?key=defzPydoc: KEYWORD def)ztopic?key=STRINGSzPydoc: TOPIC STRINGS)rzPydoc: Error - foobar)rOrT)rLZrequestsrRrCrrrtest_url_requestss  z%PydocUrlHandlerTest.test_url_requestsN)rrrrrrrrrrrsrc@seZdZddZdS) TestHelpercCs|ttjjttjdSrF)rQsortedr!rrkeywordkwlistrrrr test_keywordsszTestHelper.test_keywordsN)rrrrrrrrrsrc@seZdZeejjdkdeeedo.e dddZ eejjdkdeeedode dddZ eejjdkdeeedoe dd d Z eejjdkdeeedoe dd d Z d dZdS)PydocWithMetaClassesrXrYrZr[cCsGdddt}Gddd|d}tddtD}t}tj|d}||ttf|dd }| }| ||dS) NcseZdZfddZZS)z=PydocWithMetaClasses.test_DynamicClassAttribute..Metacs|dkr dSt|S)NhamZspamsuper __getattr__rFrrrrszIPydocWithMetaClasses.test_DynamicClassAttribute..Meta.__getattr__)rrrr __classcell__rrrrMetasrc@seZdZejddZdS)z;PydocWithMetaClasses.test_DynamicClassAttribute..DAcSsdS)NZeggsrrrrrrsz?PydocWithMetaClasses.test_DynamicClassAttribute..DA.hamN)rrrtypesDynamicClassAttributerrrrrDAsr metaclasscss|]}|rd|ndVqdS)z | rNrrrrrrszBPydocWithMetaClasses.test_DynamicClassAttribute..rrX) rrexpected_data_docstringsrr!r!expected_dynamicattribute_patternrrr#rQ)rLrrrfr0rrgrSrrrtest_DynamicClassAttributes  z/PydocWithMetaClasses.test_DynamicClassAttributecCs`Gdddt}Gddd|d}t}tj|d}||tt}|}|||dS)Ncs$eZdZddZfddZZS)zHPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta..MetacSsgdS)N)rrrLIFErrlrrr__dir__szPPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta..Meta.__dir__cs|dkr dSt|S)Nrry)rZ_Meta__getattrrFrrrrszTPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta..Meta.__getattr__rrrrrrrrrrrsrc@s eZdZdS)zIPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta..ClassNrzrrrrClasssrrr) rrr!r"expected_virtualattribute_pattern1rrr#rQ)rLrrr0rrgrSrrr%test_virtualClassAttributeWithOneMetas  z:PydocWithMetaClasses.test_virtualClassAttributeWithOneMetac sGdddtGdddtGfddd}Gdddd }Gd d d ||d }d }}t}tj|d }||tt}|} ||| t}tj|d }||t t} |} || | dS)Ncs$eZdZddZfddZZS)zIPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta1cSsgdS)N)rrrrjrrrrrrszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta1.__dir__cs|dkr dSt|S)NrjrirrFrrrrszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta1.__getattr__rrrrrMeta1srcs$eZdZddZfddZZS)zIPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta2cSsgdS)N)rrrtworrrrrrszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta2.__dir__cs|dkr dSt|S)NrrXrrFrrrrszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta2.__getattr__rrrrrMeta2srcs*eZdZfddZfddZZS)zIPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta3cs(tttgd||S)N)rrrthree)r0rsetrrrrrrrszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta3.__dir__cs|dkr dSt|S)NrrrrFrrrrszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta3.__getattr__rrrrrMeta3src@s eZdZdS)zJPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Class1NrzrrrrClass1srrc@s eZdZdS)zJPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Class2NrzrrrrClass2srFr) rrr!r"expected_virtualattribute_pattern2rrr#rQ"expected_virtualattribute_pattern3) rLrrrZfail1Zfail2r0rZexpected_text1Zresult1Zexpected_text2Zresult2rrr%test_virtualClassAttributeWithTwoMetas$      z:PydocWithMetaClasses.test_virtualClassAttributeWithTwoMetacCs`Gdddt}Gddd|d}t}tj|d}||tt}|}|||dS)Nc@seZdZddZdS)z.PydocWithMetaClasses.test_buggy_dir..McSsgdS)N)rrmissinghererrrrrrsz6PydocWithMetaClasses.test_buggy_dir..M.__dir__N)rrrrrrrrMsrc@seZdZdZdS)z.PydocWithMetaClasses.test_buggy_dir..Czpresent!N)rrrrrrrrr& sr&rr) rrr!r!expected_missingattribute_patternrrr#rQ)rLrr&r0rrgrSrrrtest_buggy_dirs  z#PydocWithMetaClasses.test_buggy_dircCsHt}tdWdn1s&0Y|}|d|dS)Nz enum.Enumz class Enum)r r!rrro)rLrrrrrtest_resolve_falses(z'PydocWithMetaClasses.test_resolve_falseN)rrrrrrurrrrZrrrrrrrrrrs:   * rc@sFeZdZddZdddZddZdd Zd d Zd d ZddZ dS)TestInternalUtilitiescCsNt}|j|_tj|jd|_||j t |_ }dtj |g|_ dS)NZ nonexistentr)tempfileTemporaryDirectoryrGargv0dirr4r5rargv0rcleanupgetcwd abs_curdircurdircurdir_spellings)rLZtmpdirrrrrrs  zTestInternalUtilities.setUpNcCs|dur|j}t||SrF)rr!_get_revised_path)rL given_pathrrrrr&sz'TestInternalUtilities._get_revised_pathcCs8tj}|jD]"}t||D]}||q"q|SrF)rur5copyrrzcountr)rL clean_pathspelling__rrr_get_starting_path-s   z(TestInternalUtilities._get_starting_pathcCs*|}|jg|}||||dSrF)rrrQr)rLr expected_pathrrr,test_sys_path_adjustment_adds_missing_curdir5s zBTestInternalUtilities.test_sys_path_adjustment_adds_missing_curdircCsT|}|jg|}|jg|}||||||jg}||||dSrF)rrrrQr)rLrrleading_argv0dirtrailing_argv0dirrrr*test_sys_path_adjustment_removes_argv0_dir:s    z@TestInternalUtilities.test_sys_path_adjustment_removes_argv0_dircshfdd}}jg|}jg|}||||jg}jg|}|||dS)Ncsj|tjdS)N)r)rr!r")rrrrrDsz\TestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir.._get_revised_path)rrrrQ)rLrrrrrrrr+test_sys_path_adjustment_protects_pydoc_dirCs     zATestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dirc Cs|}|jD]}|j|d||g|}|||||g}||||jg|}|||||jg}|||Wdq1s0YqdS)N)Zcurdir_spelling)rrZsubTestrrr)rLrrZleading_curdirZtrailing_curdirrrrrr5test_sys_path_adjustment_when_curdir_already_includedNs     zKTestInternalUtilities.test_sys_path_adjustment_when_curdir_already_included)N) rrrrrrrrrrrrrrrs   rcCs.tj}tjtjjg|RttdSrF)rrZthreading_setuprZaddModuleCleanupZthreading_cleanupr) thread_inforrr setUpModule]s r__main__)Pr4rurUimportlib.utilrr\r!rrrTrNr;r stringrZ test.supportrrrr,r urllib.parser^Z xml.etreerqZxml.etree.ElementTreerior collectionsrZtest.support.script_helperrrrrrr r r r r rrrZHAVE_DOCSTRINGSrr#rerrfrarbrlineseprrrrrrrr*r2r9r>rDZTestCaserErWrr#rrrrrrrmainrrrrs   ,  ]       RGvA