B
    u9a\— ã            !   @   sh  d Z ddddddddd	d
dddddddddddddddddddddd d!g!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 ed&d'ƒZi Zd(d„ ZedƒZedƒZedƒZedƒZedƒZedƒZeeB eB eB eB eB Zed	ƒZed
ƒZedƒZedƒZedƒZeeB eB eB eB Zd)Z d*Z!d+d,„ Z"dpd.d/„Z#d0d1„ Z$dqd3d4„Z%d5d6„ Z&G d7d8„ d8eƒZ'd9d:„ Z(d;d<„ Z)d=d>„ Z*G d?d@„ d@ej+ƒZ,dAdB„ Z-G dCd„ dƒZ.G dDd„ dƒZ/G dEd„ dƒZ0G dFd„ dƒZ1G dGd„ dƒZ2G dHd„ dƒZ3G dId„ de4ƒZ5G dJd„ de4ƒZ6G dKd„ de2ƒZ7d#a8drdNd„Z9dLd#d#d#d#dLd"d#dMe0ƒ d#fdOd„Z:dsdQd„Z;d"a<dRd„ Z=G dSdT„ dTej>ƒZ?G dUdV„ dVe?ƒZ@G dWdX„ dXejAƒZBdtdYd„ZCG dZd[„ d[e?ƒZDdLd#d#e0ƒ d#fd\d]„ZEd^d„ ZFd_d„ ZGd`d„ ZHdudad „ZIdvdbdc„ZJdwddd!„ZKG dedf„ dfƒZLeLdgdhdidjdkdlœZMdmdn„ ZNeOdokrde	 PeNƒ ¡ d#S )xzreStructuredText enÚregister_optionflagÚDONT_ACCEPT_TRUE_FOR_1ÚDONT_ACCEPT_BLANKLINEÚNORMALIZE_WHITESPACEÚELLIPSISÚSKIPÚIGNORE_EXCEPTION_DETAILÚCOMPARISON_FLAGSÚREPORT_UDIFFÚREPORT_CDIFFÚREPORT_NDIFFÚREPORT_ONLY_FIRST_FAILUREÚREPORTING_FLAGSÚ	FAIL_FASTÚExampleÚDocTestÚDocTestParserÚDocTestFinderÚDocTestRunnerÚOutputCheckerÚDocTestFailureÚUnexpectedExceptionÚDebugRunnerÚtestmodÚtestfileÚrun_docstring_examplesÚDocTestSuiteÚDocFileSuiteÚset_unittest_reportflagsÚscript_from_examplesÚ
testsourceÚ	debug_srcÚdebugé    N)ÚStringIO)Ú
namedtupleÚTestResultszfailed attemptedc             C   s   t  | dtt ƒ> ¡S )Né   )ÚOPTIONFLAGS_BY_NAMEÚ
setdefaultÚlen)Úname© r+   ú/usr/lib/python3.7/doctest.pyr   „   s    z<BLANKLINE>z...c             C   s<   d}x2t jD ](}|  |d ¡}|tt |ƒkr||jO }qW |S )Nr"   )Ú
__future__Zall_feature_namesÚgetÚgetattrZcompiler_flag)ÚglobsÚflagsZfnameZfeaturer+   r+   r,   Ú_extract_future_flags·   s    r2   é   c             C   sV   t  | ¡r| S t| tƒr,t| tƒ tƒ dgƒS | d krJtjt 	|¡j
d  S tdƒ‚d S )NÚ*Ú__name__z"Expected a module, string, or None)ÚinspectÚismoduleÚ
isinstanceÚstrÚ
__import__ÚglobalsÚlocalsÚsysÚmodulesÚ	_getframeÚ	f_globalsÚ	TypeError)ÚmoduleÚdepthr+   r+   r,   Ú_normalize_moduleÃ   s    


rD   c          	   C   s€   |r\t |dƒ}t|| ƒ} t|dd ƒd k	r\t|jdƒr\|j | ¡}| |¡}| tj	d¡| fS t
| |d}| ¡ | fS Q R X d S )Né   Ú
__loader__Úget_dataÚ
)Úencoding)rD   Ú_module_relative_pathr/   ÚhasattrrF   rG   ÚdecodeÚreplaceÚosÚlinesepÚopenÚread)ÚfilenameÚpackageÚmodule_relativerI   Zfile_contentsÚfr+   r+   r,   Ú_load_testfileÖ   s    


rV   é   c             C   s   t  d|d | ¡S )Nz
(?m)^(?!$)ú )ÚreÚsub)ÚsÚindentr+   r+   r,   Ú_indentä   s    r]   c             C   s*   t ƒ }| \}}}tj||||d | ¡ S )N)Úfile)r#   Ú	tracebackÚprint_exceptionÚgetvalue)Úexc_infoZexcoutÚexc_typeZexc_valZexc_tbr+   r+   r,   Ú_exception_tracebackì   s    
rd   c               @   s   e Zd Zdd„ Zddd„ZdS )Ú	_SpoofOutc             C   s$   t  | ¡}|r | d¡s |d7 }|S )NrH   )r#   ra   Úendswith)ÚselfÚresultr+   r+   r,   ra   ù   s    
z_SpoofOut.getvalueNc             C   s   |   |¡ t | ¡ d S )N)Úseekr#   Útruncate)rg   Úsizer+   r+   r,   rj     s    
z_SpoofOut.truncate)N)r5   Ú
__module__Ú__qualname__ra   rj   r+   r+   r+   r,   re   ø   s   	re   c             C   sÄ   t | kr| |kS |  t ¡}dt|ƒ }}|d }|rR| |¡rNt|ƒ}|d= ndS |d }|r€| |¡r||t|ƒ8 }|d= ndS ||krŒdS x2|D ]*}| |||¡}|dk r°dS |t|ƒ7 }q’W dS )Nr"   FéÿÿÿÿT)ÚELLIPSIS_MARKERÚsplitr)   Ú
startswithrf   Úfind)ÚwantÚgotZwsÚstartposÚendposÚwr+   r+   r,   Ú_ellipsis_match  s0    



rx   c             C   s   |   ¡ } | rd|  S dS d S )Nz# ú#)Úrstrip)Úliner+   r+   r,   Ú_comment_line8  s    r|   c             C   sh   dt | ƒ }}|  d¡}|dkr$|}|  dd|¡}|dkr>|}|  dd|¡}|dkr\|d }| ||… S )Nr"   rH   ú:Ú.r&   )r)   rr   Úrfind)ÚmsgÚstartÚendÚir+   r+   r,   Ú_strip_exception_details@  s    
r„   c               @   s.   e Zd Zdd„ Zd
dd„Zdd„ Zdd	„ ZdS )Ú_OutputRedirectingPdbc             C   s(   || _ d| _tjj| |dd d| _d S )NFT)ÚstdoutÚnosigintr&   )Ú_OutputRedirectingPdb__outÚ$_OutputRedirectingPdb__debugger_usedÚpdbÚPdbÚ__init__Zuse_rawinput)rg   Úoutr+   r+   r,   rŒ   `  s    z_OutputRedirectingPdb.__init__Nc             C   s*   d| _ |d krt ¡ j}tj | |¡ d S )NT)r‰   r=   r?   Úf_backrŠ   r‹   Ú	set_trace)rg   Úframer+   r+   r,   r   h  s    
z_OutputRedirectingPdb.set_tracec             C   s   | j rtj | ¡ d S )N)r‰   rŠ   r‹   Úset_continue)rg   r+   r+   r,   r‘   n  s    z"_OutputRedirectingPdb.set_continuec             G   s.   t j}| jt _ztjj| f|žŽ S |t _X d S )N)r=   r†   rˆ   rŠ   r‹   Útrace_dispatch)rg   ÚargsÚsave_stdoutr+   r+   r,   r’   t  s
    z$_OutputRedirectingPdb.trace_dispatch)N)r5   rl   rm   rŒ   r   r‘   r’   r+   r+   r+   r,   r…   Z  s   
r…   c             C   sò   t  | ¡std|  ƒ‚| d¡r(tdƒ‚tjj| d¡Ž }t	| dƒrXtj | j
¡d }nŒ| jdkržttjƒdkr–tjd dkr–tj tjd ¡d }qätj}nFt	| dƒrÖx,| jD ]"}tj ||¡}tj |¡r°|S q°W td	| j ƒ‚tj ||¡S )
NzExpected a module: %rú/z1Module-relative files may not have absolute pathsÚ__file__r"   Ú__main__Ú Ú__path__zBCan't resolve paths relative to the module %r (it has no __file__))r6   r7   rA   rq   Ú
ValueErrorrN   ÚpathÚjoinrp   rK   r–   r5   r)   r=   ÚargvÚcurdirr™   Úexists)rB   Z	test_pathZbasedirZ	directoryZfullpathr+   r+   r,   rJ     s&    





rJ   c               @   s&   e Zd Zd	dd„Zdd„ Zdd„ ZdS )
r   Nr"   c             C   sv   |  d¡s|d7 }|r(|  d¡s(|d7 }|d k	rB|  d¡sB|d7 }|| _|| _|| _|| _|d krfi }|| _|| _d S )NrH   )rf   Úsourcers   Úlinenor\   ÚoptionsÚexc_msg)rg   r    rs   r£   r¡   r\   r¢   r+   r+   r,   rŒ   Ð  s    
 zExample.__init__c             C   s\   t | ƒt |ƒk	rtS | j|jkoZ| j|jkoZ| j|jkoZ| j|jkoZ| j|jkoZ| j|jkS )N)ÚtypeÚNotImplementedr    rs   r¡   r\   r¢   r£   )rg   Úotherr+   r+   r,   Ú__eq__â  s    zExample.__eq__c             C   s   t | j| j| j| j| jfƒS )N)Úhashr    rs   r¡   r\   r£   )rg   r+   r+   r,   Ú__hash__í  s    zExample.__hash__)Nr"   r"   N)r5   rl   rm   rŒ   r§   r©   r+   r+   r+   r,   r   ­  s   # 
c               @   s4   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ ZdS )r   c             C   s,   || _ || _| ¡ | _|| _|| _|| _d S )N)ÚexamplesÚ	docstringÚcopyr0   r*   rR   r¡   )rg   rª   r0   r*   rR   r¡   r«   r+   r+   r,   rŒ   	  s    
zDocTest.__init__c             C   sR   t | jƒdkrd}n"t | jƒdkr(d}ndt | jƒ }d| jj| j| j| j|f S )Nr"   zno examplesr&   z	1 examplez%d examplesz<%s %s from %s:%s (%s)>)r)   rª   Ú	__class__r5   r*   rR   r¡   )rg   rª   r+   r+   r,   Ú__repr__  s    zDocTest.__repr__c             C   s\   t | ƒt |ƒk	rtS | j|jkoZ| j|jkoZ| j|jkoZ| j|jkoZ| j|jkoZ| j|jkS )N)r¤   r¥   rª   r«   r0   r*   rR   r¡   )rg   r¦   r+   r+   r,   r§   "  s    zDocTest.__eq__c             C   s   t | j| j| j| jfƒS )N)r¨   r«   r*   rR   r¡   )rg   r+   r+   r,   r©   -  s    zDocTest.__hash__c             C   s:   t |tƒstS | j| j| jt| ƒf|j|j|jt|ƒfk S )N)r8   r   r¥   r*   rR   r¡   Úid)rg   r¦   r+   r+   r,   Ú__lt__1  s    
zDocTest.__lt__N)r5   rl   rm   rŒ   r®   r§   r©   r°   r+   r+   r+   r,   r   ñ  s
   c               @   s¦   e Zd Ze dejejB ¡Ze dejejB ejB ¡Z	e d¡j
Zddd„Zdd„ Zdd	d
„Zdd„ Ze dej¡Zdd„ Ze dej¡Zdd„ Zdd„ Zdd„ ZdS )r   aú  
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        aß  
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$ú<string>c                s  |  ¡ }|  |¡‰ ˆ dkr8d ‡ fdd„| d¡D ƒ¡}g }d\}}xª| j |¡D ]š}| ||| ¡ … ¡ || d|| ¡ ¡7 }|  	|||¡\}}}	}
|  
|¡sÊ| t||	|
|ˆ t| d¡ƒ |d¡ || d| ¡ | ¡ ¡7 }| ¡ }qRW | ||d … ¡ |S )Nr"   rH   c                s   g | ]}|ˆ d … ‘qS )Nr+   )Ú.0Úl)Ú
min_indentr+   r,   ú
<listcomp>x  s    z'DocTestParser.parse.<locals>.<listcomp>)r"   r"   r\   )r¡   r\   r¢   )Ú
expandtabsÚ_min_indentrœ   rp   Ú_EXAMPLE_REÚfinditerÚappendr   ÚcountÚ_parse_exampleÚ_IS_BLANK_OR_COMMENTr   r)   Úgroupr‚   )rg   Ústringr*   ÚoutputZcharnor¡   Úmr    r¢   rs   r£   r+   )r´   r,   Úparsel  s&    


zDocTestParser.parsec             C   s   t |  ||¡|||||ƒS )N)r   Úget_examples)rg   r¿   r0   r*   rR   r¡   r+   r+   r,   Úget_doctest“  s    	zDocTestParser.get_doctestc             C   s   dd„ |   ||¡D ƒS )Nc             S   s   g | ]}t |tƒr|‘qS r+   )r8   r   )r²   Úxr+   r+   r,   rµ   ª  s    z.DocTestParser.get_examples.<locals>.<listcomp>)rÂ   )rg   r¿   r*   r+   r+   r,   rÃ   Ÿ  s    zDocTestParser.get_examplesc       
         s
  t | d¡ƒ‰ | d¡ d¡}|  |ˆ ||¡ |  |dd … dˆ  d ||¡ d ‡ fdd„|D ƒ¡}| d	¡}| d¡}t |ƒdkrœt d
|d ¡rœ|d= |  |dˆ  ||t |ƒ ¡ d ‡ fdd„|D ƒ¡}| j |¡}|rì| d¡}nd }|  	|||¡}	||	||fS )Nr\   r    rH   r&   rX   r~   c                s   g | ]}|ˆ d  d… ‘qS )rW   Nr+   )r²   Úsl)r\   r+   r,   rµ   À  s    z0DocTestParser._parse_example.<locals>.<listcomp>rs   z *$rn   c                s   g | ]}|ˆ d … ‘qS )Nr+   )r²   Zwl)r\   r+   r,   rµ   Ë  s    r€   )
r)   r¾   rp   Ú_check_prompt_blankÚ_check_prefixrœ   rY   ÚmatchÚ_EXCEPTION_REÚ_find_options)
rg   rÁ   r*   r¡   Úsource_linesr    rs   Ú
want_linesr£   r¢   r+   )r\   r,   r¼   ­  s$     

zDocTestParser._parse_examplez#\s*doctest:\s*([^\n\'"]*)$c       	      C   s´   i }xŠ| j  |¡D ]z}| d¡ dd¡ ¡ }x^|D ]V}|d dksR|dd … tkrhtd|d ||f ƒ‚t|dd …  }|d dk||< q2W qW |r°|  |¡r°td|||f ƒ‚|S )	Nr&   ú,rX   r"   z+-z7line %r of the doctest for %s has an invalid option: %rú+zSline %r of the doctest for %s has an option directive on a line with no example: %r)Ú_OPTION_DIRECTIVE_REr¹   r¾   rM   rp   r'   rš   r½   )	rg   r    r*   r¡   r¢   rÁ   Úoption_stringsÚoptionÚflagr+   r+   r,   rË   ã  s    
zDocTestParser._find_optionsz^([ ]*)(?=\S)c             C   s2   dd„ | j  |¡D ƒ}t|ƒdkr*t|ƒS dS d S )Nc             S   s   g | ]}t |ƒ‘qS r+   )r)   )r²   r\   r+   r+   r,   rµ     s    z-DocTestParser._min_indent.<locals>.<listcomp>r"   )Ú
_INDENT_REÚfindallr)   Úmin)rg   r[   Úindentsr+   r+   r,   r·     s    zDocTestParser._min_indentc          	   C   sb   x\t |ƒD ]P\}}t|ƒ|d kr
||d  dkr
td|| d ||||d … |f ƒ‚q
W d S )NrW   rE   rX   z8line %r of the docstring for %s lacks blank after %s: %rr&   )Ú	enumerater)   rš   )rg   Úlinesr\   r*   r¡   rƒ   r{   r+   r+   r,   rÇ   	  s
     z!DocTestParser._check_prompt_blankc             C   sB   x<t |ƒD ]0\}}|r
| |¡s
td|| d ||f ƒ‚q
W d S )NzGline %r of the docstring for %s has inconsistent leading whitespace: %rr&   )rØ   rq   rš   )rg   rÙ   Úprefixr*   r¡   rƒ   r{   r+   r+   r,   rÈ     s    zDocTestParser._check_prefixN)r±   )r±   )r5   rl   rm   rY   ÚcompileÚ	MULTILINEÚVERBOSEr¸   ÚDOTALLrÊ   rÉ   r½   rÂ   rÄ   rÃ   r¼   rÐ   rË   rÔ   r·   rÇ   rÈ   r+   r+   r+   r,   r   <  s    	
'
3c               @   sJ   e Zd Zdeƒ ddfdd„Zddd„Zdd	„ Zd
d„ Zdd„ Zdd„ Z	dS )r   FTc             C   s   || _ || _|| _|| _d S )N)Ú_parserÚ_verboseÚ_recurseÚ_exclude_empty)rg   ÚverboseÚparserÚrecurseÚexclude_emptyr+   r+   r,   rŒ   0  s    zDocTestFinder.__init__Nc       	   	   C   sN  |d kr.t |dd ƒ}|d kr.tdt|ƒf ƒ‚|dkr<d }n|d krNt |¡}yt |¡}W n tk
rt   d }Y ndX |s t |¡}|d |dd …  dks d }|d kr®d }n*|d k	rÆt 	||j
¡}n
t 	|¡}|sØd }|d krú|d krîi }n
|j
 ¡ }n| ¡ }|d k	r| |¡ d|kr(d|d< g }|  ||||||i ¡ | ¡  |S )Nr5   zJDocTestFinder.find: name must be given when obj.__name__ doesn't exist: %rFr"   éþÿÿÿz<]>r—   )r/   rš   r¤   r6   Ú	getmoduleZgetsourcefilerA   ZgetfileÚ	linecacheÚgetlinesÚ__dict__r¬   ÚupdateÚ_findÚsort)	rg   Úobjr*   rB   r0   Ú
extraglobsr^   rÌ   Útestsr+   r+   r,   rr   F  sJ    $


 



zDocTestFinder.findc             C   sÂ   |d krdS t  |¡d k	r(|t  |¡kS t  |¡r>|j|jkS t  |¡r|t|dƒr\|jj}nt|dƒrn|j}ndS |j	|kS t  
|¡r’|j	|jkS t|dƒr¨|j	|jkS t|tƒr¶dS tdƒ‚d S )NTÚ__objclass__rl   z"object must be a class or function)r6   rè   Ú
isfunctionrë   Ú__globals__ZismethoddescriptorrK   rò   rl   r5   Úisclassr8   Úpropertyrš   )rg   rB   ÚobjectZobj_modr+   r+   r,   Ú_from_module¬  s(    








zDocTestFinder._from_modulec          
   C   s*  | j rtd| ƒ t|ƒ|kr"d S d|t|ƒ< |  |||||¡}|d k	rR| |¡ t |¡rÂ| jrÂx^|j 	¡ D ]P\}	}
d||	f }	t 
t |
¡¡sœt |
¡rn|  ||
¡rn|  ||
|	||||¡ qnW t |¡rv| jrvxžt|di ƒ 	¡ D ]Š\}	}
t|	tƒstdt|	ƒf ƒ‚t 
|
¡sPt |
¡sPt |
¡sPt|
tƒsPtdt|
ƒf ƒ‚d||	f }	|  ||
|	||||¡ qèW t |¡r&| jr&xš|j 	¡ D ]Œ\}	}
t|
tƒr´t||	ƒ}
t|
tƒrÌt||	ƒj}
t 
|
¡sðt |
¡sðt|
tƒr–|  ||
¡r–d||	f }	|  ||
|	||||¡ q–W d S )NzFinding tests in %sr&   z%s.%sÚ__test__z5DocTestFinder.find: __test__ keys must be strings: %rz`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rz%s.__test__.%s)rà   Úprintr¯   Ú	_get_testrº   r6   r7   rá   rë   ÚitemsZ	isroutineZunwraprõ   rø   rí   r/   r8   r9   rš   r¤   ÚstaticmethodÚclassmethodÚ__func__rö   )rg   rñ   rï   r*   rB   rÌ   r0   ÚseenÚtestZvalnameÚvalr+   r+   r,   rí   È  sP    


zDocTestFinder._findc       	   	   C   sÀ   t |tƒr|}nJy,|jd kr"d}n|j}t |tƒs:t|ƒ}W n ttfk
rX   d}Y nX |  ||¡}| jrt|std S |d kr‚d }n*t|d|jƒ}|dd … dkr¬|d d… }| j	 
|||||¡S )Nr˜   r–   éüÿÿÿz.pycrn   )r8   r9   Ú__doc__rA   ÚAttributeErrorÚ_find_linenorâ   r/   r5   rß   rÄ   )	rg   rï   r*   rB   r0   rÌ   r«   r¡   rR   r+   r+   r,   rû     s(    




zDocTestFinder._get_testc             C   s  d }t  |¡rd}t  |¡rd|d kr(d S t dt|ddƒ ¡}x$t|ƒD ]\}}| |¡rH|}P qHW t  |¡rt|j	}t  
|¡r„|j}t  |¡r”|j}t  |¡r¤|j}t  |¡r¾t|dd ƒd }|d k	r|d krØ|d S t d¡}x(t|t|ƒƒD ]}| || ¡rò|S qòW d S )Nr"   z^\s*class\s*%s\br5   ú-Úco_firstlinenor&   z(^|.*:)\s*\w*("|\'))r6   r7   rõ   rY   rÛ   r/   rØ   rÉ   Zismethodrÿ   ró   Ú__code__ZistracebackÚtb_frameZisframeÚf_codeZiscodeÚranger)   )rg   rï   rÌ   r¡   Zpatrƒ   r{   r+   r+   r,   r  ,  s<    



 
 
 
 


zDocTestFinder._find_lineno)NNNN)
r5   rl   rm   r   rŒ   rr   rø   rí   rû   r  r+   r+   r+   r,   r   '  s   	
f?%c               @   s‚   e Zd ZdZddd„Zdd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Z	dd„ Z
dd„ Ze d¡Zddd„Zd dd„Zd!dd„Zdd„ ZdS )"r   zF**********************************************************************Nr"   c             C   sN   |pt ƒ | _|d krdtjk}|| _|| _|| _d| _d| _i | _	t
ƒ | _d S )Nz-vr"   )r   Ú_checkerr=   r   rà   ÚoptionflagsÚoriginal_optionflagsÚtriesÚfailuresÚ_name2ftre   Ú_fakeout)rg   Úcheckerrã   r  r+   r+   r,   rŒ   œ  s    
zDocTestRunner.__init__c             C   sH   | j rD|jr.|dt|jƒ d t|jƒ ƒ n|dt|jƒ d ƒ d S )NzTrying:
zExpecting:
zExpecting nothing
)rà   rs   r]   r    )rg   r   r  Úexampler+   r+   r,   Úreport_startÀ  s     zDocTestRunner.report_startc             C   s   | j r|dƒ d S )Nzok
)rà   )rg   r   r  r  rt   r+   r+   r,   Úreport_successÍ  s    zDocTestRunner.report_successc             C   s&   ||   ||¡| j ||| j¡ ƒ d S )N)Ú_failure_headerr  Úoutput_differencer  )rg   r   r  r  rt   r+   r+   r,   Úreport_failureÕ  s    zDocTestRunner.report_failurec             C   s$   ||   ||¡d tt|ƒƒ ƒ d S )NzException raised:
)r  r]   rd   )rg   r   r  r  rb   r+   r+   r,   Úreport_unexpected_exceptionÜ  s    z)DocTestRunner.report_unexpected_exceptionc             C   s”   | j g}|jrR|jd k	r4|jd k	r4|j|j d }nd}| d|j||jf ¡ n| d|jd |jf ¡ | d¡ |j}| t|ƒ¡ d |¡S )Nr&   ú?zFile "%s", line %s, in %szLine %s, in %szFailed example:rH   )ÚDIVIDERrR   r¡   rº   r*   r    r]   rœ   )rg   r  r  r   r¡   r    r+   r+   r,   r  ã  s    
zDocTestRunner._failure_headerc          	   C   sŒ  d }}| j }tdƒ\}}}	| jj}
xFt|jƒD ]6\}}| j t@ oL|dk}|| _ |jr–x:|j ¡ D ],\}}|r‚|  j |O  _ qf|  j | M  _ qfW | j t	@ r¢q2|d7 }|s¼|  
|||¡ d|j|f }y,tt|j|d|dƒ|jƒ | j ¡  d }W n4 tk
r   ‚ Y n   t ¡ }| j ¡  Y nX | j ¡ }| j d¡ |}|d krh|
|j|| j ƒrä|}n|tj|d d… Ž d }|s|t|ƒ7 }|jd kr¢|	}nB|
|j|| j ƒrº|}n*| j t@ rä|
t|jƒt|ƒ| j ƒrä|}||kr|sZ|  ||||¡ nT||kr0|s&|   ||||¡ |d7 }n*||	krZ|sP|  !||||¡ |d7 }n |r2| j t"@ r2P q2W || _ |  #|||¡ t$||ƒS )Nr"   rE   r&   z<doctest %s[%d]>Zsingler3   rn   )%r  r  r  Úcheck_outputrØ   rª   r   r¢   rü   r   r  r*   ÚexecrÛ   r    r0   Údebuggerr‘   ÚKeyboardInterruptr=   rb   r  ra   rj   rs   r_   Úformat_exception_onlyrd   r£   r   r„   r  r  r  r   Ú_DocTestRunner__record_outcomer%   )rg   r  Úcompileflagsr   r  r  r  ÚSUCCESSÚFAILUREZBOOMZcheckÚ
examplenumr  ÚquietZ
optionflagr  rR   Z	exceptionrt   Zoutcomer£   r+   r+   r,   Z__run÷  s€    












zDocTestRunner.__runc             C   sL   | j  |jd¡\}}|| || f| j |j< |  j|7  _|  j|7  _d S )N)r"   r"   )r  r.   r*   r  r  )rg   r  rU   ÚtÚf2Út2r+   r+   r,   Z__record_outcomet  s    zDocTestRunner.__record_outcomez.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$c             C   sV   | j  |¡}|rF| d¡| jjkrF| jjt| d¡ƒ }|jjddS |  	||¡S d S )Nr*   r'  T)Úkeepends)
Ú%_DocTestRunner__LINECACHE_FILENAME_RErÉ   r¾   r  r*   rª   Úintr    Ú
splitlinesÚsave_linecache_getlines)rg   rR   Úmodule_globalsrÁ   r  r+   r+   r,   Z__patched_linecache_getlines  s
    z*DocTestRunner.__patched_linecache_getlinesTc       	   	      sþ   || _ |d krt|jƒ}tj‰|d krVˆj‰ ˆ d ks@ˆ  ¡ dkrHˆj}n‡ ‡fdd„}| jt_t 	¡ }t
j}tˆƒ| _| j ¡  | jjt
_tj| _| jt_tj}tjt_z|  |||¡S ˆt_|t
_t |¡ | jt_|t_|rø|j ¡  dd l}d |_X d S )Nzutf-8c                s    t |  ˆ d¡ˆ ƒ} ˆ | ¡ d S )NÚbackslashreplace)r9   ÚencodeÚwrite)r[   )rI   r”   r+   r,   r   ©  s    zDocTestRunner.run.<locals>.outr"   )r  r2   r0   r=   r†   rI   Úlowerr4  r  ÚgettracerŠ   r   r…   r   Úresetré   rê   r0  Ú*_DocTestRunner__patched_linecache_getlinesÚdisplayhookÚ__displayhook__Ú_DocTestRunner__runÚsettraceÚclearÚbuiltinsÚ_)	rg   r  r$  r   Úclear_globsZ
save_traceZsave_set_traceZsave_displayhookr>  r+   )rI   r”   r,   Úrun‰  s<    





zDocTestRunner.runc             C   s¢  |d kr| j }g }g }g }d }}xd| j ¡ D ]V}|\}\}	}
||
7 }||	7 }|
dkrb| |¡ q.|	dkrz| ||
f¡ q.| |¡ q.W |rú|r¾tt|ƒdƒ | ¡  x|D ]}td|ƒ q¬W |rútt|ƒdƒ | ¡  x |D ]\}}td||f ƒ qÞW |rJt| jƒ tt|ƒdƒ | ¡  x(|D ] \}\}	}
td|	|
|f ƒ q&W |rvt|dt| jƒd	ƒ t|| d
|dƒ |rŠtd|dƒ n|r˜tdƒ t||ƒS )Nr"   zitems had no tests:z   zitems passed all tests:z %3d tests in %szitems had failures:z %3d of %3d in %sztests inzitems.z
passed andzfailed.z***Test Failed***z	failures.zTest passed.)	rà   r  rü   rº   rú   r)   rî   r  r%   )rg   rã   ZnotestsZpassedZfailedZtotaltZtotalfrÅ   r*   rU   r)  Úthingr»   r+   r+   r,   Ú	summarizeÒ  sP    

zDocTestRunner.summarizec             C   sV   | j }xJ|j  ¡ D ]<\}\}}||krB|| \}}|| }|| }||f||< qW d S )N)r  rü   )rg   r¦   Údr*   rU   r)  r*  r+  r+   r+   r,   Úmerge  s    zDocTestRunner.merge)NNr"   )N)NNT)N)r5   rl   rm   r  rŒ   r  r  r  r  r  r;  r#  rY   rÛ   r-  r8  rA  rC  rE  r+   r+   r+   r,   r   `  s   :
$}



I
9c               @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
r   c             C   s   t | dd¡dƒS )NÚASCIIr2  )r9   r3  )rg   r[   r+   r+   r,   Ú_toAscii   s    zOutputChecker._toAsciic             C   sÌ   |   |¡}|   |¡}||kr dS |t@ sH||fdkr8dS ||fdkrHdS |t@ s‚t dt t¡ d|¡}t dd|¡}||kr‚dS |t@ r²d | 	¡ ¡}d | 	¡ ¡}||kr²dS |t
@ rÈt||ƒrÈdS dS )	NT)zTrue
z1
)zFalse
z0
z(?m)^%s\s*?$r˜   z(?m)^[^\S\n]+$rX   F)rG  r   r   rY   rZ   ÚescapeÚBLANKLINE_MARKERr   rœ   rp   r   rx   )rg   rs   rt   r  r+   r+   r,   r  &  s0    


zOutputChecker.check_outputc             C   s<   |t tB tB @ sdS |t@ r dS | d¡dko:| d¡dkS )NFTrH   r3   )r	   r
   r   r»   )rg   rs   rt   r  r+   r+   r,   Ú_do_a_fancy_diffe  s    zOutputChecker._do_a_fancy_diffc       
      C   s(  |j }|t@ st dt|¡}|  |||¡rà|jdd}|jdd}|t@ rptj	||dd}t
|ƒdd … }d}nZ|t@ ržtj||dd}t
|ƒdd … }d}n,|t@ rÊtjtjd}	t
|	 ||¡ƒ}d	}n d
| td |¡ƒ S |rü|rüdt|ƒt|ƒf S |rdt|ƒ S |r dt|ƒ S dS d S )Nz(?m)^[ ]*(?=
)T)r,  r3   )Únz#unified diff with -expected +actualz-context diff with expected followed by actual)Zcharjunkzndiff with -expected +actualzDifferences (%s):
r˜   zExpected:
%sGot:
%szExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)rs   r   rY   rZ   rI  rJ  r/  r	   ÚdifflibZunified_diffÚlistr
   Zcontext_diffr   ZDifferZIS_CHARACTER_JUNKZcomparer]   rœ   )
rg   r  rt   r  rs   rÍ   Z	got_linesZdiffÚkindZenginer+   r+   r,   r  |  s4    zOutputChecker.output_differenceN)r5   rl   rm   rG  r  rJ  r  r+   r+   r+   r,   r     s   ?c               @   s   e Zd Zdd„ Zdd„ ZdS )r   c             C   s   || _ || _|| _d S )N)r  r  rt   )rg   r  r  rt   r+   r+   r,   rŒ   µ  s    zDocTestFailure.__init__c             C   s
   t | jƒS )N)r9   r  )rg   r+   r+   r,   Ú__str__º  s    zDocTestFailure.__str__N)r5   rl   rm   rŒ   rO  r+   r+   r+   r,   r   ª  s   c               @   s   e Zd Zdd„ Zdd„ ZdS )r   c             C   s   || _ || _|| _d S )N)r  r  rb   )rg   r  r  rb   r+   r+   r,   rŒ   È  s    zUnexpectedException.__init__c             C   s
   t | jƒS )N)r9   r  )rg   r+   r+   r,   rO  Í  s    zUnexpectedException.__str__N)r5   rl   rm   rŒ   rO  r+   r+   r+   r,   r   ½  s   c               @   s&   e Zd Zd	dd„Zdd„ Zdd„ ZdS )
r   NTc             C   s$   t  | |||d¡}|r |j ¡  |S )NF)r   rA  r0   r=  )rg   r  r$  r   r@  Úrr+   r+   r,   rA  +  s    
zDebugRunner.runc             C   s   t |||ƒ‚d S )N)r   )rg   r   r  r  rb   r+   r+   r,   r  1  s    z'DebugRunner.report_unexpected_exceptionc             C   s   t |||ƒ‚d S )N)r   )rg   r   r  r  rt   r+   r+   r,   r  4  s    zDebugRunner.report_failure)NNT)r5   rl   rm   rA  r  r  r+   r+   r+   r,   r   Ð  s   [
TFc	             C   sº   | d krt j d¡} t | ¡s,td| f ƒ‚|d kr:| j}t|d}	|rVt||d}
nt	||d}
x$|	j
| |||dD ]}|
 |¡ qvW |r”|
 ¡  td kr¢|
an
t |
¡ t|
j|
jƒS )Nr—   ztestmod: module required; %r)ræ   )rã   r  )r0   rð   )r=   r>   r.   r6   r7   rA   r5   r   r   r   rr   rA  rC  ÚmasterrE  r%   r  r  )rÁ   r*   r0   rã   Úreportr  rð   Úraise_on_errorræ   ÚfinderÚrunnerr  r+   r+   r,   r   @  s$    E


c             C   sÞ   |r|st dƒ‚t| |||pdƒ\}} |d kr:tj | ¡}|d krHi }n| ¡ }|d k	rb| |¡ d|krrd|d< |	r„t||d}nt||d}|
 	|||| d¡}| 
|¡ |r¸| ¡  td krÆ|an
t |¡ t|j|jƒS )Nz8Package may only be specified for module-relative paths.zutf-8r5   r—   )rã   r  r"   )rš   rV   rN   r›   Úbasenamer¬   rì   r   r   rÄ   rA  rC  rQ  rE  r%   r  r  )rR   rT   r*   rS   r0   rã   rR  r  rð   rS  rä   rI   ÚtextrU  r  r+   r+   r,   r   ¨  s0    R


ÚNoNamec       	      C   sD   t |dd}t||d}x&|j| ||dD ]}|j||d q*W d S )NF)rã   rå   )rã   r  )r0   )r$  )r   r   rr   rA  )	rU   r0   rã   r*   r$  r  rT  rU  r  r+   r+   r,   r   #  s    c             C   s"   | t @ | krtd| ƒ‚t}| a|S )NzOnly reporting flags allowed)r   rš   Ú_unittest_reportflags)r1   Úoldr+   r+   r,   r   @  s
    
c               @   sj   e Zd Zddd„Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ ZeZdd„ ZdS )ÚDocTestCaser"   Nc             C   s.   t j | ¡ || _|| _|| _|| _|| _d S )N)ÚunittestÚTestCaserŒ   Ú_dt_optionflagsÚ_dt_checkerÚ_dt_testÚ	_dt_setUpÚ_dt_tearDown)rg   r  r  ÚsetUpÚtearDownr  r+   r+   r,   rŒ   f  s    zDocTestCase.__init__c             C   s   | j }| jd k	r|  |¡ d S )N)r`  ra  )rg   r  r+   r+   r,   rc  p  s    
zDocTestCase.setUpc             C   s(   | j }| jd k	r|  |¡ |j ¡  d S )N)r`  rb  r0   r=  )rg   r  r+   r+   r,   rd  v  s    

zDocTestCase.tearDownc             C   s~   | j }tj}tƒ }| j}|t@ s(|tO }t|| jdd}z d|_	|j
||jdd\}}W d |t_X |rz|  |  | ¡ ¡¡‚d S )NF)r  r  rã   zF----------------------------------------------------------------------)r   r@  )r`  r=   r†   r#   r^  r   rY  r   r_  r  rA  r4  ZfailureExceptionÚformat_failurera   )rg   r  rZ  Únewr  rU  r  r  r+   r+   r,   ÚrunTest~  s    zDocTestCase.runTestc             C   sP   | j }|jd krd}n
d|j }d |j d¡dd … ¡}d|j|j|||f S )Nzunknown line numberz%sr~   rn   z:Failed doctest test for %s
  File "%s", line %s, in %s

%s)r`  r¡   rœ   r*   rp   rR   )rg   Úerrr  r¡   Zlnamer+   r+   r,   re  –  s    

zDocTestCase.format_failurec             C   s6   |   ¡  t| j| jdd}|j| jdd |  ¡  d S )NF)r  r  rã   )r@  )rc  r   r^  r_  rA  r`  rd  )rg   rU  r+   r+   r,   r!   ¢  s
    BzDocTestCase.debugc             C   s   | j jS )N)r`  r*   )rg   r+   r+   r,   r¯   ê  s    zDocTestCase.idc             C   sP   t | ƒt |ƒk	rtS | j|jkoN| j|jkoN| j|jkoN| j|jkoN| j|jkS )N)r¤   r¥   r`  r^  ra  rb  r_  )rg   r¦   r+   r+   r,   r§   í  s    zDocTestCase.__eq__c             C   s   t | j| j| j| jfƒS )N)r¨   r^  ra  rb  r_  )rg   r+   r+   r,   r©   ÷  s    zDocTestCase.__hash__c             C   s,   | j j d¡}d|d d |d d… ¡f S )Nr~   z%s (%s)rn   )r`  r*   rp   rœ   )rg   r*   r+   r+   r,   r®   û  s    zDocTestCase.__repr__c             C   s   d| j j S )Nz	Doctest: )r`  r*   )rg   r+   r+   r,   ÚshortDescription	  s    zDocTestCase.shortDescription)r"   NNN)r5   rl   rm   rŒ   rc  rd  rg  re  r!   r¯   r§   r©   r®   rO  ri  r+   r+   r+   r,   r[  d  s    
	H
r[  c               @   s0   e Zd Zdd„ Zdd„ Zdd„ Zdd„ ZeZd	S )
ÚSkipDocTestCasec             C   s   || _ t | d ¡ d S )N)rB   r[  rŒ   )rg   rB   r+   r+   r,   rŒ   	  s    zSkipDocTestCase.__init__c             C   s   |   d¡ d S )Nz-DocTestSuite will not work with -O2 and above)ZskipTest)rg   r+   r+   r,   rc  		  s    zSkipDocTestCase.setUpc             C   s   d S )Nr+   )rg   r+   r+   r,   Ú	test_skip	  s    zSkipDocTestCase.test_skipc             C   s   d| j j S )NzSkipping tests from %s)rB   r5   )rg   r+   r+   r,   ri  	  s    z SkipDocTestCase.shortDescriptionN)r5   rl   rm   rŒ   rc  rk  ri  rO  r+   r+   r+   r,   rj  	  s
   rj  c               @   s   e Zd Zdd„ ZdS )Ú_DocTestSuitec             C   s   d S )Nr+   )rg   Úindexr+   r+   r,   Ú_removeTestAtIndex	  s    z _DocTestSuite._removeTestAtIndexN)r5   rl   rm   rn  r+   r+   r+   r,   rl  	  s   rl  c       	      K   s¾   |d krt ƒ }t| ƒ} |j| ||d}|sNtjjdkrNtƒ }| t| ƒ¡ |S | 	¡  tƒ }x\|D ]T}t
|jƒdkrvqb|js¤| j}|dd … dkrž|d d… }||_| t|f|Ž¡ qbW |S )N)r0   rð   r3   r"   r  z.pycrn   )r   rD   rr   r=   r1   Úoptimizerl  ÚaddTestrj  rî   r)   rª   rR   r–   r[  )	rB   r0   rð   Ztest_finderr¢   rñ   Úsuiter  rR   r+   r+   r,   r   	  s(    %
c               @   s(   e Zd Zdd„ Zdd„ ZeZdd„ ZdS )ÚDocFileCasec             C   s   d  | jj d¡¡S )Nr?  r~   )rœ   r`  r*   rp   )rg   r+   r+   r,   r¯   ]	  s    zDocFileCase.idc             C   s   | j jS )N)r`  rR   )rg   r+   r+   r,   r®   `	  s    zDocFileCase.__repr__c             C   s   d| j j| j j|f S )Nz2Failed doctest test for %s
  File "%s", line 0

%s)r`  r*   rR   )rg   rh  r+   r+   r,   re  d	  s    zDocFileCase.format_failureN)r5   rl   rm   r¯   r®   rO  re  r+   r+   r+   r,   rr  [	  s   rr  c       
      K   sv   |d kri }n|  ¡ }|r&|s&tdƒ‚t| |||p4dƒ\}} d|krL| |d< tj | ¡}| |||| d¡}	t|	f|ŽS )Nz8Package may only be specified for module-relative paths.zutf-8r–   r"   )r¬   rš   rV   rN   r›   rV  rÄ   rr  )
r›   rT   rS   r0   rä   rI   r¢   Údocr*   r  r+   r+   r,   ÚDocFileTesti	  s    rt  c              O   sH   t ƒ }| dd¡r$t| d¡ƒ|d< x| D ]}| t|f|Ž¡ q*W |S )NrT   TrS   )rl  r.   rD   rp  rt  )ÚpathsÚkwrq  r›   r+   r+   r,   r   ƒ	  s    8
c             C   sÚ   g }xˆt ƒ  | ¡D ]x}t|tƒrj| |jd d… ¡ |j}|rŠ| d¡ |dd„ | d¡d d… D ƒ7 }q|dd„ | d¡d d… D ƒ7 }qW x|rª|d dkrª| ¡  qW x|rÊ|d dkrÊ| d¡ q®W d 	|¡d S )	Nrn   z# Expected:c             S   s   g | ]}d | ‘qS )z## r+   )r²   r³   r+   r+   r,   rµ   
  s    z(script_from_examples.<locals>.<listcomp>rH   c             S   s   g | ]}t |ƒ‘qS r+   )r|   )r²   r³   r+   r+   r,   rµ   
  s   ry   r"   )
r   rÂ   r8   r   rº   r    rs   rp   Úpoprœ   )r[   rÀ   Zpiecers   r+   r+   r,   r   Ì	  s    :

"c                sJ   t | ƒ} tƒ  | ¡}‡ fdd„|D ƒ}|s4tˆ dƒ‚|d }t|jƒ}|S )Nc                s   g | ]}|j ˆ kr|‘qS r+   )r*   )r²   r)  )r*   r+   r,   rµ   '
  s    ztestsource.<locals>.<listcomp>znot found in testsr"   )rD   r   rr   rš   r   r«   )rB   r*   rñ   r  Útestsrcr+   )r*   r,   r   
  s    

c             C   s   t | ƒ}t|||ƒ d S )N)r   Údebug_script)ÚsrcÚpmr0   rx  r+   r+   r,   r    .
  s    c             C   s”   dd l }|r| ¡ }ni }|rvyt| ||ƒ W q   tt ¡ d ƒ |jdd}| ¡  | d t ¡ d ¡ Y qX n|jdd 	d|  ||¡ d S )Nr"   r&   T)r‡   r3   zexec(%r))
rŠ   r¬   r  rú   r=   rb   r‹   r7  ZinteractionrA  )rz  r{  r0   rŠ   Úpr+   r+   r,   ry  3
  s    
ry  c             C   s$   t | ƒ} t| |ƒ}t||| jƒ d S )N)rD   r   ry  rë   )rB   r*   r{  rx  r+   r+   r,   r!   G
  s    
c               @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )Ú
_TestClassc             C   s
   || _ d S )N)r  )rg   r  r+   r+   r,   rŒ   c
  s    z_TestClass.__init__c             C   s   | j d | _ | S )Nr3   )r  )rg   r+   r+   r,   Úsquarem
  s    z_TestClass.squarec             C   s   | j S )N)r  )rg   r+   r+   r,   r.   w
  s    z_TestClass.getN)r5   rl   rm   rŒ   r~  r.   r+   r+   r+   r,   r}  U
  s   

r}  zÄ
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      aÜ  
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    zç
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            zú
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            aƒ  
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            )r}  r¿   zbool-int equivalencezblank linesZellipsiszwhitespace normalizationc              C   s*  dd l } | jdd}|jdddddd	 |jd
ddt ¡ g dd |jddddd |jdddd | ¡ }|j}|j}d}x|jD ]}|t| O }q„W |j	r¦|t
O }x~|D ]v}| d¡rtj |¡\}}tj d|¡ t|d d… ƒ}	tjd= t|	||d\}
}nt|d||d\}
}|
r¬dS q¬W dS )Nr"   zdoctest runner)Údescriptionz-vz	--verboseÚ
store_trueFz'print very verbose output for all tests)ÚactionÚdefaultÚhelpz-oz--optionrº   zqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r  Úchoicesr‚  rƒ  z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r  rƒ  r^   rÏ   z file containing the tests to run)Únargsrƒ  z.pyéýÿÿÿ)rã   r  )rT   rã   r  r&   )ÚargparseÚArgumentParserÚadd_argumentr'   ÚkeysÚ
parse_argsr^   rã   rÒ   Z	fail_fastr   rf   rN   r›   rp   r=   Úinsertr:   r   r   )r‡  rä   r“   Z	testfilesrã   r¢   rÒ   rR   ÚdirnamerÁ   r  r?  r+   r+   r,   Ú_test´
  s>    


rŽ  r—   )r3   )rW   )	NNNNTr"   NFF)FrX  Nr"   )NNNN)FN)FN)F)QZ__docformat__Ú__all__r-   rL  r6   ré   rN   rŠ   rY   r=   r_   r\  Úior#   Úcollectionsr$   r%   r'   r   r   r   r   r   r   r   r   r	   r
   r   r   r   r   rI  ro   r2   rD   rV   r]   rd   re   rx   r|   r„   r‹   r…   rJ   r   r   r   r   r   r   Ú	Exceptionr   r   r   rQ  r   r   r   rY  r   r]  r[  rj  Z	TestSuiterl  r   rr  rt  r   r   r   r    ry  r!   r}  rù   rŽ  r5   Úexitr+   r+   r+   r,   Ú<module>0   s  


1%.DK l  ;   ; n  
fx 
$ !
@IR


,		-
