a ze@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@s eZdZdS)nonasciiN__name__ __module__ __qualname__rrC/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_pydoc.pyr#sr).dictionary for instance variables (if defined)2list of weak references to the object (if defined)rr)rrraq 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) | | ---------------------------------------------------------------------- | 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' VERSION 1.2.3.4 AUTHOR Benjamin Peterson CREDITS Nobody FILE %s ccs|]}|rd|ndVqdS)z | rNr.0srrr sra*
 
 
test.pydoc_mod (version 1.2.3.4)
index
%s%s

This is a test module for test_pydoc

 
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)

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'

 
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)Nz-B)rpydoc__file__strip) module_nameargsenvrcouterrrrr run_pydocRs  r)cCs<t}||}|tpd}|r0d|d}||fS)Nrz
Module Docs)r HTMLDoc docmodule getdoclocrr")moduledocoutputlocrrrget_pydoc_html\s   r1cCs:tjj}tjj}|||t}t}|j||d}|S)N)basedir)ospathabspathdirnamer!r TextDocr,)r-r5r6r2r.r0rrrget_pydoc_linkes r8cCsRt}|tpd}|r&d|d}||}td}|d|}||fS)Nrz MODULE DOCS r.) r r7r,rr+recompilesubr")r-r.r0r/Zpattrrrget_pydoc_textns    r=cCs4|d\}}}|d\}}}|d\}}}|S)Nzzz) partition)textheader_titlerrrget_html_title|srCc@s.eZdZdddZejd ddZddZdS) PydocBaseTestNcs&|ptjtgdfdd }|S)Nrcs|p||SNr)r4prefixonerrorZ default_path walk_packagesrrwrappersz8PydocBaseTest._restricted_walk_packages..wrapper)NrN)r3r4r6r!)selfrIr4rJrrHr_restricted_walk_packagessz'PydocBaseTest._restricted_walk_packagesccs2tj}|||t_zdVW|t_n|t_0dSrE)pkgutilrIrL)rKr4rIrrrrestrict_walk_packagessz$PydocBaseTest.restrict_walk_packagescCs&t|d}t|}|||||S)Nz text/html)r _url_handlerrC assertEqual)rKurlZexpected_titler?resultrrrcall_url_handlers zPydocBaseTest.call_url_handler)N)N)rrrrL contextlibcontextmanagerrNrSrrrrrDs  rDc@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}| ||dSrE) r1rinspect getabsfileurllibparsequoteexpected_html_patternexpected_html_data_docstringsrP)rKrRdoc_locZmod_fileZmod_urlZ expected_htmlrrr test_html_docs   zPydocDocTest.test_html_doccCs6tt\}}t|ftttf}|||dSrE)r=rexpected_text_patternexpected_text_data_docstringsr[r\rP)rKrRrb 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 BinaryIntegersrjz)enumIntEnumr render_docassertIn)rKrkrjr.rrr%test_text_enum_member_with_value_zeros z2PydocDocTest.test_text_enum_member_with_value_zerocCsttjj}|d|dS)Nzxml.etree.elementtree)r8xmletreeZ ElementTreern)rKZdoc_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=rprqrP)rKrRrbrrrtest_issue8225szPydocDocTest.test_issue8225cCs,tj}zdt_tW|t_n|t_0dSrE)sysstdinr getpager)rKZprevious_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*NrrrrrAsryc@s eZdZdS)z)PydocDocTest.test_non_str_name..BNrrrrrBsrz)r rmrPr)rKryrzZadocZbdocrrrtest_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_patternrPrKZmissing_modulerRexpectedrrr test_not_heres zPydocDocTest.test_not_herez)Docstrings are omitted with -OO and abovecCs*tddd}tjdd}|||dS)Nztest.test_pydoc.nonasciir})ZPYTHONIOENCODINGbackslashreplace)r)r__doc__encodern)rKrRencodedrrrtest_not_asciis zPydocDocTest.test_not_asciicCs.d}tt|d}t|}|||dS)Nz test.i_am_not_here r})r~r)rr"rPrrrrtest_input_strips zPydocDocTest.test_input_stripcCsJtj}||dd||dd||dd||dddS)Nzzz Z42z)r stripidrP)rKrrrr test_stripids   zPydocDocTest.test_stripidcCs&t}|t}d}|||dS)Nz | Built-in subclasses: | async_generator | BaseException | builtin_function_or_method | bytearray | ... and \d+ other subclasses)r r7docclassobjectZ assertRegexrKr.r?Zsniprrr)test_builtin_with_more_than_four_children s z6PydocDocTest.test_builtin_with_more_than_four_childrencCs&t}|t}d}|||dS)Nzc | Built-in subclasses: | FloatingPointError | OverflowError | ZeroDivisionError)r r7rArithmeticErrorrnrrrrtest_builtin_with_child(s z$PydocDocTest.test_builtin_with_childcCs2t}|t}d}||||d|dS)Nz^ | Built-in subclasses: | ArithmeticError | AssertionError | AttributeErrorZeroDivisionError)r r7r Exceptionrn assertNotInrrrrtest_builtin_with_grandchildCs   z)PydocDocTest.test_builtin_with_grandchildcCs"t}|t}|d|dSNzBuilt-in subclasses)r r7rrrrKr.r?rrrtest_builtin_no_childcs z"PydocDocTest.test_builtin_no_childcCs"t}|t}|d|dSr)r r7rtyperrrrrtest_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|SrEr)xrrrzJPydocDocTest.test_help_output_redirect....rrrrrrrz8PydocDocTest.test_help_output_redirect..r/ztest.pydoc_modz9 Help on module test.pydoc_mod in test: stdoutstderrr)rdr rvmaxDiffrHelperr=rlstriptextwrapdedentr helpgetvaluer"rer[r\rP)rKZ old_patternZ getpager_oldZ getpager_newbufhelperZunusedrbr-Z help_headerZexpected_help_patternr/r(rRrfrrrtest_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 rrrn)rKrhelp_iohelptextrrrtest_namedtuple_fieldss(   z#PydocDocTest.test_namedtuple_fieldscCsrtdddgdd}t}t|Wdn1s80Y|}|d||d||d|dS) NNTabcdefT)renameZ_1_replace_asdictr)rKrrrrrr!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 synopsisrP)rKrZscriptrrrr test_synopsiss  * zPydocDocTest.test_synopsiscCs.tjd}tj}t|}|||dS)Nr)r3r splitlines __cached__r rrP)rKrfilenamerrrrtest_synopsis_sourcelesss z%PydocDocTest.test_synopsis_sourcelessc Cstj}tj|d}tj|}t |d}| dWdn1sP0Yt |t |i}||t |i}||Wdn1s0YdS)Nz foomod42.pyrfoo = 1)testsupporttemp_cwdr3r4join importlibutilcache_from_sourcerwrite py_compiler;r r assertIsNone)rKtest_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)rPr Zsplitdoc)rKZexample_stringrrrtest_splitdoc_with_descriptions z+PydocDocTest.test_splitdoc_with_descriptioncCs>tj }|t|Wdn1s00YdSrE)rrrZ assertFalser ispackage)rKrrrr test_is_package_when_not_packages z-PydocDocTest.test_is_package_when_not_packagecCsdtjF}tj|d}t|d|t |t |Wdn1sV0YdS)N __init__.pyr) rrrr3r4rrclose assertTruer rremove)rKrrrrrtest_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)NTrrKrrrmethod_returning_trueszEPydocDocTest.test_allmethods..TestClass.method_returning_trueN)rrrrrrrr TestClasssrrr __class____subclasshook____init_subclass__) rdictvarsrrrr Z allmethodsZassertDictEqual)rKrrmethodsrrrtest_allmethodss     zPydocDocTest.test_allmethodscspGdddGfddd}t|}tdd|}||dttj|td}||d tdS) Nc@s"eZdZdddZeZddZdS)z+PydocDocTest.test_method_aliases..ANcSsdSrEr)rKZ aboveThisrrrtkraisesz3PydocDocTest.test_method_aliases..A.tkraisecSsdSrErrrrra_sizesz2PydocDocTest.test_method_aliases..A.a_size)N)rrrrZliftrrrrrrys rycs eZdZdddZeZjZdS)z+PydocDocTest.test_method_aliases..BNc[sdSrEr)rKZtagOrIdZcnfkwrrr itemconfiguresz9PydocDocTest.test_method_aliases..B.itemconfigure)N)rrrrZ itemconfigrZb_sizerryrrrzs rzr9raPython 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 rmr:r<rPrr*)rKrzr.rrrtest_method_aliasess %'(z PydocDocTest.test_method_aliases)'rrrrunittestskipIfrtflagsoptimizehasattrrYr rcrgrorrrsrwr{rrrrrrrrrrrrrrrrrrrrrrrrrVsn       #     rVc@szeZdZddZddZddZddZd d Zd d Ze d ddZ e d ddZ e dddZ ddZdS)PydocImportTestcCs$tt|_|tttdSrE)r3mkdirrrrrrinvalidate_cachesrrrrsetUpss  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}) rr3r4rrextseprrr)decodebadimport_patternrP) rKmodnameZ testpairsZsourcefnZ importstringZ expectedinmsgfrRrrrrtest_badimportxs   . 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 r4Zxyzzyr)r3r4rrrrrrrNr r r aproposrPrr")rKpkgdirZ 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)r3r4rrZunreadable_dirrrrmdirrNr r r rrPr)rKr'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)r3r4rrrrrrrstatS_IMODEst_modechmodS_IEXECrNr r rrnr)rKrrrZ 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_packagerZwtr}rzraise ValueError("ouch") rrZouchzsearch?key=test_error_packagePydoc: Search Resultsz8test_error_package)r3r4rrrrrrNtuplertinsertZassertRaisesRegex ValueErrorr rSrn)rKrinitrZ saved_pathsr r?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)NrWrmodules)rr rrr"lenrZassertGreaterEqual) rKZnum_header_linesZnum_module_lines_minZnum_footer_linesrr/rrRZ num_linesrrr test_moduless    zPydocImportTest.test_modulescCs\d}t}tj|d}t}|dWdn1s:0Y|}|||dS)Nzpydoc - rz modules pydoc)rr rr rrnrKrr/rrrRrrrtest_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 assertIsNotrPr__spec__)rKZ loaded_pydocrrrtest_importfiles   zPydocImportTest.test_importfileN)rrrrrrrr rrskiprrrrrrrrrqs   rc@seZdZddZddZddZddZed d Zed d Z d dZ e ddZ ddZ ddZe ddZe ddZe ddZe ddZe ddZe dd Ze d!d"Ze d#d$Ze d%d&Ze d'd(Ze d)d*Ze d+d,Ze d-d.Zd/d0Zd1d2Zd3d4Zd5S)6TestDescriptionscCs&ddlm}t|}|d|dS)Nr) pydocfodderr")rr"r rmrn)rKr"r.rrr test_module s  zTestDescriptions.test_modulecCsVGddd}|}|t|d|t|ddt}||t|dS)Nc@s eZdZdS)z&TestDescriptions.test_class..CNrrrrrCrr$zclass CzC in module %s object)rPr Zdescriberrnrm)rKr$crrrr test_classs zTestDescriptions.test_classcCstjtjttjtjttjfddd}td}Gdddtj|tjtt f}| t | dd| t | d d dS) N)datarreturncSsdSrEr)r'rrrrfoosz/TestDescriptions.test_typing_pydoc..fooTc@s eZdZdS)z-TestDescriptions.test_typing_pydoc..CNrrrrrr$ rr$z?ffoooo(data: List[Any], x: int) -> Iterator[Tuple[int, Any]]rWz2class CC(collections.abc.Mapping, typing.Generic))typingListAnyintIteratorTupleTypeVarGenericMappingr~rPr rmr)rKr)r*r$rrrtest_typing_pydocs   "z"TestDescriptions.test_typing_pydocc CszdD]F}|t|zt|WqtyH|d|Yq0qdD]$}|t||ttj|qPdS)N)r~z str.translatez builtins.strzbuiltins.str.translatezfinding the doc of {!r} failed)Z notbuiltinsZstrrrzstrr.translatezstr.trrrranslatezbuiltins.strrrzbuiltins.str.trrranslate) ZassertIsNotNoner Zlocaterm ImportErrorZfailrr assertRaisesrKnamerrr test_builtin's zTestDescriptions.test_builtincCs"tt|}|d}|dSNrrW)r plainrmsplitor?linesrrr_get_summary_line8s z"TestDescriptions._get_summary_linecCs,tt|}|d}d|ddSr;)r r<rmr=rr>rrr_get_summary_lines?s z#TestDescriptions._get_summary_linescCs||tjjddS)Nzwrap(self, text))rPrAr TextWrapperwraprrrrtest_unbound_python_methodFsz+TestDescriptions.test_unbound_python_methodcCs||tjjddS)Nzdump(self, obj, /))rPrA_picklePicklerdumprrrrtest_unbound_builtin_methodJsz,TestDescriptions.test_unbound_builtin_methodcCs t}|||jddS)Nz2wrap(text) method of textwrap.TextWrapper instance)rrCrPrArD)rKtrrrtest_bound_python_methodPsz)TestDescriptions.test_bound_python_methodcCs|tdgd}t|}||d|d||d|dGddd}Gdd d }t|t|dS) Nr)rragegrouprrrLc@seZdZdZdS)zMTestDescriptions.test_field_order_for_named_tuples..NonIterableFieldsNrrr_fieldsrrrrNonIterableFieldsZsrOc@seZdZggZdS)zMTestDescriptions.test_field_order_for_named_tuples..NonHashableFieldsNrMrrrrNonHashableFields]srP)rr rmZ assertLessindex)rKrrrOrPrrr!test_field_order_for_named_tuplesTs  z2TestDescriptions.test_field_order_for_named_tuplescCs(t}t|}|||jddS)Nz/dump(obj, /) method of _pickle.Pickler instance)rrFrGrPrArH)rKrprrrtest_bound_builtin_methodds  z*TestDescriptions.test_bound_builtin_methodcCs||tjddS)Nz0stat(path, *, dir_fd=None, follow_symlinks=True))rPrAr3rrrrrtest_module_level_callablelsz+TestDescriptions.test_module_level_callablecCsVGddd}|||jdd|||jd|dtt|dS)Nc@seZdZeddZdS)z-TestDescriptions.test_staticmethod..XcSsdSrErryrrrsmtsz0TestDescriptions.test_staticmethod..X.smN)rrr staticmethodrXrrrrXssrZrXzzsm(x, y) A static method zL | Static methods defined here: | | sm(x, y) | A static method )rPrB__dict__rXrnr r<rmrKrZrrrtest_staticmethodqsz"TestDescriptions.test_staticmethodcCsVGddd}|||jdd|||jd|dtt|dS)Nc@seZdZeddZdS)z,TestDescriptions.test_classmethod..XcSsdSrEr)clsrrrrcmsz/TestDescriptions.test_classmethod..X.cmN)rrr classmethodr_rrrrrZsrZr_zz:cm(x) method of builtins.type instance A class method zZ | Class methods defined here: | | cm(x) from builtins.type | A class method )rPrBr[r_rnr r<rmr\rrrtest_classmethodsz!TestDescriptions.test_classmethodcCsT||tjd||tjd||tjd||tj ddS)N numeratorrealr$obj) rPrAr/rbfloatrcrr$ memoryviewrdrrrrtest_getset_descriptorsz'TestDescriptions.test_getset_descriptorcCsh||tjd||tjd||tjd||tjd||t j ddS)Nrcstartfgetvalue) rPrAcomplexrcrangerhslicepropertyri StopIterationrjrrrrtest_member_descriptors z'TestDescriptions.test_member_descriptorcCs&Gddd}|||jddS)Nc@seZdZdZdS)z4TestDescriptions.test_slot_descriptor..PointrVN)rrr __slots__rrrrPointsrrr)rPrAr)rKrrrrrtest_slot_descriptorsz%TestDescriptions.test_slot_descriptorcCs*Gddd}|||jdddS)Nc@s eZdZdS)z6TestDescriptions.test_dict_attr_descriptor..NSNrrrrrNSsrtr[)rPrAr[)rKrtrrrtest_dict_attr_descriptorsz*TestDescriptions.test_dict_attr_descriptorcCsl||ttjjd||ttjjd||ttjj d||ttj j ddS)Nwidthdebugmajormax) rPrArrt hash_inforvrrw version_inforx float_inforyrrrr test_structseq_member_descriptorsz1TestDescriptions.test_structseq_member_descriptorcCs"tdd}|||jddS)NBox)rvZheightz Alias for field number 0 )rrPrBrv)rKr~rrr test_namedtuple_field_descriptors z1TestDescriptions.test_namedtuple_field_descriptorcCs>Gddd}|||jd|dtt|dS)Nc@seZdZeddZdS)z,TestDescriptions.test_property..RectcSs |j|jSrE)rhrrrrareasz1TestDescriptions.test_property..Rect.areaN)rrrrnrrrrrRectsrz Area of the rect z# | area | Area of the rect )rPrBrrnr r<rm)rKrrrr test_propertys zTestDescriptions.test_propertycspGdddGfddd}|||jdd|j_|||jdd|j_|||jd dS) Nc@seZdZddZdS)z?TestDescriptions.test_custom_non_data_descriptor..DescrcSs|dur |SdSNrxrrKrdr^rrr__get__szGTestDescriptions.test_custom_non_data_descriptor..Descr.__get__N)rrrrrrrrDescrsrcseZdZZdS)z;TestDescriptions.test_custom_non_data_descriptor..XNrrrattrrrrrrZsrZzX.Descr object>Custom descriptorzo.Descr object> Custom descriptor r)zfoo(...) Custom descriptor rPrBrrrr\rrrtest_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 |SdSrrrrrrrszCTestDescriptions.test_custom_data_descriptor..Descr.__get__cSs dddS)Nrhrrrrrr__set__szCTestDescriptions.test_custom_data_descriptor..Descr.__set__N)rrrrrrrrrrsrcseZdZZdS)z7TestDescriptions.test_custom_data_descriptor..XNrrrrrrZsrZrrz Custom descriptor r)zfoo Custom descriptor rr\rrrtest_custom_data_descriptorsz,TestDescriptions.test_custom_data_descriptorcCsJtddd}ttj|}|d|t|}|d|dS)N)r(csdSNrhr)Zignrrr coro_functionsz=TestDescriptions.test_async_annotation..coro_functionzasync coro_functionz4async coro_function)r/r r< plaintextdocumentrnr*)rKrr?htmlrrrtest_async_annotation s z&TestDescriptions.test_async_annotationcCsDdd}ttj|}|d|t|}|d|dS)NcSs dVdSrrrrrran_async_generatorszLTestDescriptions.test_async_generator_annotation..an_async_generatorzasync an_async_generatorz>async an_async_generator)r r<rrrnr*)rKrr?rrrrtest_async_generator_annotations z0TestDescriptions.test_async_generator_annotationcCs&dd}t|}|d|dS)NcSsdSrErrrrra_fn_with_https_link&szHTestDescriptions.test_html_for_https_links..a_fn_with_https_linkz3https://localhost/)r r*rrn)rKrrrrrtest_html_for_https_links%s z*TestDescriptions.test_html_for_https_linksN)rrrr#r&r5r:rYrArBrEr rIrKrRrTrUr]rargrprsrur}rrrrrrrrrrrr! sT                    r!c@seZdZddZdS)PydocServerTestcCs|dd}tj|ddd}|d|jjt}tjj }|j rjt d|j r8t||kr8| qjq8| |jddS)NcSsd||f}|S)Nzthe URL sent was: (%s, %s)r)rQZ content_typer?rrrmy_url_handler6s z3PydocServerTest.test_server..my_url_handlerz0.0.0.0r)hostnameportg{Gz?)r Z _start_serverrnZ docserveraddresstime monotonicrrZ SHORT_TIMEOUTZservingsleepstoprPerror)rKrZ serverthreadZ starttimetimeoutrrr test_server3s zPydocServerTest.test_serverN)rrrrrrrrr0src@seZdZddZddZdS)PydocUrlHandlerTestcCs*tj}|t|dd|t|dddS)Nryrrzfoobar)r rOr7 TypeError)rKrrrrtest_content_type_errLsz)PydocUrlHandlerTest.test_content_type_errcCsNgd}|*|D]\}}|||qWdn1s@0YdS)N) )rPydoc: Index of Modules)zget?key=r)rQr)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)rNrS)rKZrequestsrQrBrrrtest_url_requestsQs  z%PydocUrlHandlerTest.test_url_requestsN)rrrrrrrrrrIsrc@seZdZddZdS) TestHelpercCs|ttjjttjdSrE)rPsortedr rrkeywordkwlistrrrr test_keywordsiszTestHelper.test_keywordsN)rrrrrrrrrhsrc@seZdZeejjdkdeeedo.e dddZ eejjdkdeeedode dddZ eejjdkdeeedoe dd d Z eejjdkdeeedoe dd d Z d dZdS)PydocWithMetaClassesrWrXrYrZcCsGdddt}Gddd|d}tddtD}t}tj|d}||ttf|dd }| }| ||dS) NcseZdZfddZZS)z=PydocWithMetaClasses.test_DynamicClassAttribute..Metacs|dkr dSt|S)NhamZspamsuper __getattr__r8rrrrtszIPydocWithMetaClasses.test_DynamicClassAttribute..Meta.__getattr__)rrrr __classcell__rrrrMetassrc@seZdZejddZdS)z;PydocWithMetaClasses.test_DynamicClassAttribute..DAcSsdS)NZeggsrrrrrrysz?PydocWithMetaClasses.test_DynamicClassAttribute..DA.hamN)rrrtypesDynamicClassAttributerrrrrDAxsr metaclasscss|]}|rd|ndVqdS)z | rNrrrrrr|szBPydocWithMetaClasses.test_DynamicClassAttribute..rrW) rrexpected_data_docstringsrr r!expected_dynamicattribute_patternrrr"rP)rKrrrer/rrfrRrrrtest_DynamicClassAttributens  z/PydocWithMetaClasses.test_DynamicClassAttributecCs`Gdddt}Gddd|d}t}tj|d}||tt}|}|||dS)Ncs$eZdZddZfddZZS)zHPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta..MetacSsgdS)N)rrrLIFErr^rrr__dir__szPPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta..Meta.__dir__cs|dkr dSt|S)Nrrx)rZ_Meta__getattrr8rrrrszTPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta..Meta.__getattr__rrrrrrrrrrrsrc@s eZdZdS)zIPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta..ClassNrrrrrClasssrrr) rrr r"expected_virtualattribute_pattern1rrr"rP)rKrrr/rrfrRrrr%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)rrrrirrrrrrszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta1.__dir__cs|dkr dSt|S)Nrirhrr8rrrrszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta1.__getattr__rrrrrMeta1srcs$eZdZddZfddZZS)zIPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta2cSsgdS)N)rrrtworrrrrrszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta2.__dir__cs|dkr dSt|S)NrrWrr8rrrrszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta2.__getattr__rrrrrMeta2srcs*eZdZfddZfddZZS)zIPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta3cs(tttgd||S)N)rrrthree)listrsetrrrrrrrszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta3.__dir__cs|dkr dSt|S)Nrrrr8rrrrszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Meta3.__getattr__rrrrrMeta3src@s eZdZdS)zJPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Class1NrrrrrClass1srrc@s eZdZdS)zJPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta..Class2NrrrrrClass2srFr) rrr r"expected_virtualattribute_pattern2rrr"rP"expected_virtualattribute_pattern3) rKrrrZfail1Zfail2r/rZexpected_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"rP)rKrr$r/rrfrRrrrtest_buggy_dirs  z#PydocWithMetaClasses.test_buggy_dircCsHt}tdWdn1s&0Y|}|d|dS)Nz enum.Enumz class Enum)r r rrrn)rKrrrrrtest_resolve_falses(z'PydocWithMetaClasses.test_resolve_falseN)rrrrrrtrrrrYrrrrrrrrrrms:   * rc@sFeZdZddZdddZddZdd Zd d Zd d ZddZ dS)TestInternalUtilitiescCsNt}|j|_tj|jd|_||j t |_ }dtj |g|_ dS)NZ nonexistentr)tempfileTemporaryDirectoryr9argv0dirr3r4rargv0rcleanupgetcwd abs_curdircurdircurdir_spellings)rKZtmpdirrrrrrs  zTestInternalUtilities.setUpNcCs|dur|j}t||SrE)rr _get_revised_path)rK given_pathrrrrrsz'TestInternalUtilities._get_revised_pathcCs8tj}|jD]"}t||D]}||q"q|SrE)rtr4copyrrlcountr)rK clean_pathspelling__rrr_get_starting_paths   z(TestInternalUtilities._get_starting_pathcCs*|}|jg|}||||dSrE)rrrPr)rKr expected_pathrrr,test_sys_path_adjustment_adds_missing_curdirs zBTestInternalUtilities.test_sys_path_adjustment_adds_missing_curdircCsT|}|jg|}|jg|}||||||jg}||||dSrE)rrrrPr)rKrrleading_argv0dirtrailing_argv0dirrrr*test_sys_path_adjustment_removes_argv0_dirs    z@TestInternalUtilities.test_sys_path_adjustment_removes_argv0_dircshfdd}}jg|}jg|}||||jg}jg|}|||dS)Ncsj|tjdS)N)r)rr r!)rrrrr sz\TestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir.._get_revised_path)rrrrP)rKrrrrrrrr+test_sys_path_adjustment_protects_pydoc_dir s     zATestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dirc Cs|}|jD]}|j|d||g|}|||||g}||||jg|}|||||jg}|||Wdq1s0YqdS)N)Zcurdir_spelling)rrZsubTestrrr)rKrrZleading_curdirZtrailing_curdirrrrrr5test_sys_path_adjustment_when_curdir_already_includeds     zKTestInternalUtilities.test_sys_path_adjustment_when_curdir_already_included)N) rrrrrrrrrrrrrrrs   rcCs.tj}tjtjjg|RttdSrE)rrZthreading_setuprZaddModuleCleanupZthreading_cleanupr) thread_inforrr setUpModule$s r__main__)Pr3rtrTimportlib.utilrr[r rrrFrMr:rstringrZ test.supportrrrr,r urllib.parser]Z xml.etreerpZxml.etree.ElementTreerior collectionsrZtest.support.script_helperrrrrrr r r r r rrrZHAVE_DOCSTRINGSrr"rdrrer`rarlineseprrrrrrrr)r1r8r=rCZTestCaserDrVrr!rrrrrrrmainrrrrs   ,  T{      R(vA