
    cb                     2   d Z dZddlmZ ddlZddlZddlmZ ddl	Z	ddl
Z
ddlmZ ddlmZ ddlmZmZmZmZmZmZmZmZ ddlmZ ddlZddlZdd	lmZmZ ddlZ dd
l!m"Z" ddl#m$Z$m%Z%  e&e dd      s	 ddl'Zddl'm(Z( n
ddlZddlm(Z( g dZ+dZ,  ed      e      Z-dZ. ed      dedefd       Z/d Z0d Z1e,dddfdZ2d Z3edLdee   defd       Z4e4Z5d edefd!Z6 G d" d#e7      Z8ejr                  Z9 G d$ d%e:      Z; G d& d'e<      Z=ej|                  Z? G d( d)e(      Z@d*eeAd+f   deeeeB   eeA   f   ef   fd,ZC G d- d.e<      ZD G d/ d0eE      ZFd1 ZG G d2 d3ej                        ZH  ed4      eHj                        eH_I         G d5 d6ejr                        ZJ G d7 d8ej                        ZK G d9 d:eHe;      ZL G d< d=      ZMd*edd>fd?ZNd@eeO   dAeOddfdBZP G dC dD      ZQdEeOdFedefdGZRdHeOdefdIZSdJeOdefdKZTy# e)$ r  e)de*z        w xY w)Ma  Run tests.

This will find all modules whose name match a given prefix in the test
directory, and run them. Various command line options provide
additional facilities.

Command line options:

 -v  verbose -- run tests in verbose mode with output to stdout
 -q  quiet   -- don't print anything except if a test fails
 -t  testdir -- directory where the tests will be found
 -x  exclude -- add a test to exclude
 -p  profile -- profiled execution
 -d  dbc     -- enable design-by-contract
 -m  match   -- only run test matching the tag pattern which follow

If no non-option arguments are present, prefixes used are 'test',
'regrtest', 'smoketest' and 'unittest'.

zrestructuredtext en    )contextmanagerN)rmtree)isgeneratorfunction)AnyIteratorUnionOptionalCallableDictListTuple)NoReturn)class_deprecatedcallable_deprecatedwraps)cachedclassproperty__package__)SkipTestz.You have to install python-unittest2 to use %s)unittest_main
find_tests
nocoveragepause_trace)testregrtest	smoketestunittestfunc
validationz*[lgc 0.63] use inspect.isgeneratorfunction   z<with_tempdir is deprecated, use tempfile.TemporaryDirectory.callablereturnc           
           t               r5dt        dt        dt        t        t        t        t           f      f fd}|S t               dt        dt        dt        f fd       }|S )zA decorator ensuring no temporary file left when the function return
    Work only for temporary file created with the tempfile moduleargskwargsr#   c               ?   L  K   t        j                         }t        j                  d      }|t         _        	  | i |D ]  }|  	 	 t	        |d       |t         _        y # |t         _        w xY w# 	 t	        |d       |t         _        w # |t         _        w xY wxY wwNz	temp-lgc-)prefixT)ignore_errorstempfile
gettempdirmkdtemptempdirr   )r%   r&   
old_tmpdir
new_tmpdirxr"   s        8/usr/lib/python3/dist-packages/logilab/common/testlib.pyproxyzwith_tempdir.<locals>.proxyb   s     !,,.J!))=J)H2!4262 AG2:T:'1H$zH$2:T:'1H$zH$sF   6B$A6 A& B$&A33B$6B!8BB!BB!!B$kargsc                  .   t        j                         }t        j                  d      }|t         _        	  | i |	 t	        |d       |t         _        S # |t         _        w xY w# 	 t	        |d       |t         _        w # |t         _        w xY wxY wr(   r+   )r%   r5   r0   r1   r"   s       r3   r4   zwith_tempdir.<locals>.proxys   s{    !,,.J!))=J)H2//2:T:'1H$zH$2:T:'1H$zH$s/   A)  AA&)B+B8BBB)r   r   r   r   strr   r"   r4   s   ` r3   with_tempdirr9   \   sv     8$	2 	2 	2xRU?V9W0X 	2  
x
	2 
	2s 
	2s 
	2 

	2     c                 .     t                fd       }|S )zEA decorator moving the enclosed function inside the tempfile.tempfdirc                      t        j                         }t        j                  t        j                         	  | i |t        j                  |       S # t        j                  |       w xY wN)osgetcwdchdirr,   r/   )r%   r5   old_cwdr"   s      r3   r4   zin_tempdir.<locals>.proxy   sK    ))+
!!"	T+U+HHWBHHWs   A A.r   r8   s   ` r3   
in_tempdirrB      s"     8_  Lr:   c                 P    t        t        |             }| j                  |_        |S )zMA decorator run the enclosed function inside a tmpdir removed after execution)r9   rB   __name__r8   s     r3   within_tempdirrE      s#    H-.E&&ENLr:   z.py Tc                 (   g }t        j                  |       D ]g  }|r|j                  |      s|D ]L  }|j                  |      s|r |j                  |      r|dt	        |        }||vs<|j                  |       N i |j                          |S )z7
    Return a list of all applicable test modules.
    N)r>   listdirendswith
startswithlenappendsort)testdirprefixessuffixexcludesremove_suffixtestsnamer)   s           r3   r   r      s     E

7# +v." +??6*$v)>#Ns6{l38+T*++ 
JJLLr:   c                    | j                   }| j                  | j                  z   }t        |      dk(  r|d   j	                          y	 d}t        d       t        dj                  t        |      D cg c]  \  }\  }}d|d| c}}}             t        d       t                	 t        d      }|j                         j                         d	k(  rt                y	 t        |      }|||   d      }|j	                          c c}}}w # t        t        f$ r t        d
|       Y 'w xY w# t        t        f$ r t                Y yw xY w)z?starts an interactive shell so that the user can inspect errorsr!   r   zChoose a test to debug:
	z : zType 'exit' (or ^D) to quitzEnter a test name: exitzERROR: invalid test number N)	debuggerserror_descrsfail_descrsrK   startprintjoin	enumerateinputstriplowerint
ValueError
IndexErrorEOFErrorKeyboardInterrupt)	resultrY   descrs	testindexi_descrtodebugdebuggers	            r3   start_interactive_moderp      s9     I  6#5#55F
9~!I+,$))9U[K\]]-!ZaAu5]^_/0G 56==?((*f4G)$'L	#,VI->q-A#B !('  ^ '
3 LJKL /0 s<   5D-6D6 %D ;D6 D30D6 2D33D6 6EEtracec              #   Z  K   t        j                         }t        j                  |        	 d |#t        |      st	        |d      r|j
                  }t        j                  |       y# |#t        |      st	        |d      r|j
                  }t        j                  |       w xY ww)z<A context manager that temporary replaces the trace functionNpytrace)sysgettracesettracer"   hasattrrs   )rq   oldtraces     r3   replace_tracery      s      ||~HLL (:wxQZ?[''HX (:wxQZ?[''HXs   *B+A, ;B+,<B((B+r   c                 p     t         d      r S d _        dt        dt        dt        f fd}d|_        |S )z0Function decorator that pauses tracing functions	uncoveredTr%   r&   r#   c                  T    t               5   | i |cd d d        S # 1 sw Y   y xY wr=   )r   )r%   r&   r   s     r3   not_coveredznocoverage.<locals>.not_covered   s*    ] 	)((	) 	) 	)s   ')rw   r{   r   )r   r}   s   ` r3   r   r      sE    t[! DN)3 )# )# ) !Kr:   c                       e Zd ZdZdZdZdZy)_DebugResultzCUsed by the TestSuite to hold previous class when running in debug.NF)rD   
__module____qualname____doc___previousTestClass_moduleSetUpFailed
shouldStoprF   r:   r3   r   r      s    IJr:   r   c                       e Zd ZdZy)keywordsz5Keyword args (**kwargs) support for generative tests.NrD   r   r   r   rF   r:   r3   r   r     s    ?r:   r   c                       e Zd ZdZd Zy)starargsz0Variable arguments (*args) for generative tests.c                 .    t         j                  | |      S r=   )tuple__new__)clsr%   s     r3   r   zstarargs.__new__
  s    }}S$''r:   N)rD   r   r   r   r   rF   r:   r3   r   r     s
    :(r:   r   c                       e Zd ZdZy)InnerTestSkippedzraised when a test is skippedNr   rF   r:   r3   r   r     s    'r:   r   params.c                 *   g }d}i }d}| D ]  }t        |t              r#|}|rt        d      |dz  }|t        |      z  }6t        |t              r|}|dz  rt        d      |dz  }^|dz  s|dz  rt        d      |j                  |        ||fS )NrF   r   zfound starargs after keywords !      z got multiple keywords parametersz%found parameters after kwargs or args)
isinstancer   	TypeErrorlistr   rL   )r   r%   varargsr&   flagsparams         r3   parse_generative_argsr     s    DGFE eX&G ABBQJEDM!Dx(Fqy BCCQJEQY%!)CDDKK" <r:   c                       e Zd Zd Zy)	InnerTestc                 @    t         j                  | |      }||_        |S r=   )r   r   rT   )r   rT   datainstances       r3   r   zInnerTest.__new__/  s    ==d+r:   N)rD   r   r   r   rF   r:   r3   r   r   .  s    r:   r   c                   \     e Zd ZdZdededdf fdZdedefdZd	edefd
Z	d fdZ
 xZS )Tagsz(A set of tag able validate an expressiontagsr&   r#   Nc                     |j                  dd      | _        |rt        d|j                         z        t	        |      dk(  rt        |d   t              s|d   }t        t        | '  |       y )NinheritTz4%s are an invalid keyword argument for this functionr!   r   )
popr   r   keysrK   r   r7   superr   __init__)selfr   r&   	__class__s      r3   r   zTags.__init__8  sc    zz)T2RU[U`U`Ubbcct9>*T!Wc":7DdD"4(r:   keyc                 
    || v S r=   rF   )r   r   s     r3   __getitem__zTags.__getitem__A  s    d{r:   expc                     t        |i |       S r=   )eval)r   r   s     r3   matchz
Tags.matchD  s     CT""r:   c                 6    t        t        t         |   |       S r=   )r   r   __or__)r   otherr   s     r3   r   zTags.__or__M  s    U4-e455r:   )r   r   r#   r   )rD   r   r   r   r7   r   r   boolr   r   r   __classcell__r   s   @r3   r   r   5  sP    2)c )S )T )s t # # #6 6r:   r   c                       fd}|S )Nc                  d    t        j                  dj                  z  t        d        | i |S )NzPlease use %s instead.r   )warningswarnrD   DeprecationWarning)r%   r&   original_funcs     r3   deprecated_funcz#_deprecate.<locals>.deprecated_funcS  s1    /-2H2HHK]_`ad-f--r:   rF   )r   r   s   ` r3   
_deprecater   R  s    . r:   c                       e Zd ZdZdZ e       Zddeddf fdZe	e
defd              Zededefd       Zd	 Zdee   f fd
Zdededededef
dZdefdZddZddZ	 ddedededefdZ	 	 ddededeee   ee   ed   f   dee   def
dZddedefdZ e!jD                  dk\  re#jH                  jJ                  Z& xZ'S e#jH                  jL                  Z% xZ'S )TestCasez;A unittest.TestCase extension with some additional methods.N
methodNamer#   c                     t         t        |   |       t        j                  | _        | j                  | _        d | _        d | _	        y r=   )
r   r   r   rt   exc_info_TestCase__exc_info_testMethodName_TestCase__testMethodName_current_test_descr	_options_)r   r   r   s     r3   r   zTestCase.__init__`  s:    h&z2,, $ 4 4#' r:   c                     t         j                  | j                     }t        j                  t        j
                  t        j                  |j                              d      S )zphelper attribute holding the standard test's data directory

        NOTE: this is a logilab's standard
        r   )rt   modulesr   ospr^   dirnameabspath__file__)r   mods     r3   datadirzTestCase.datadirg  s=     kk#..)xxCKK$=>GGr:   fnamec                 B    t        j                  | j                  g| S )z&joins the object's datadir and `fname`)r   r^   r   )r   r   s     r3   datapathzTestCase.datapatht  s     xx,e,,r:   c                     || _         y)zsets the current test's description.
        This can be useful for generative tests because it allows to specify
        a description per yield
        N)r   )r   rm   s     r3   set_descriptionzTestCase.set_descriptiony  s    
 $) r:   c                 X    | j                   | j                   S t        t        |          S )z`override default unittest shortDescription to handle correctly
        generative tests
        )r   r   r   shortDescription)r   r   s    r3   r   zTestCase.shortDescription  s-     ##/+++Xt577r:   rh   r   r%   r&   c                 p   	  ||i | y# t         t        f$ r  t        j                  $ r^}t	        |d      r|j                  | t        |             n,t        j                  dt        d       |j                  |        Y d }~yd }~wt        $ r# |j                  | | j                                Y yw xY w)NaddSkip4TestResult has no addSkip method, skips not reportedr   FT)rg   
SystemExitr   r   rw   r   r7   r   r   RuntimeWarning
addSuccess	ExceptionaddErrorr   )r   rh   r   r%   r&   es         r3   	quiet_runzTestCase.quiet_run  s    	$!&!  ":. 	   	vy)tSV,JN\] !!$' 	OOD$//"34	s    "B5AB,B54B5c                 .    t        | | j                        S )zreturn the test method)getattrr   r   s    r3   _get_test_methodzTestCase._get_test_method  s    tT1122r:   c                 0    t        | j                  ||      S )z>return the option value or default if the option is not define)r   r   )r   optiondefaults      r3   optvalzTestCase.optval  s    t~~vw77r:   c                    || j                         }|| _        | j                         }t        | j                  dd      st        |dd      r	 t        | j                  dd      xs t        |dd      }t        |d      r|j                  | |       n,t        j                  dt        d       |j                  |        |j                  |        y|r	 ||      sy|j                  |        	 | j                  || j                        s	 |j                  |        yt        |      }|r| j!                  |||       n| j#                  ||      }|d	k(  }| j                  || j$                        s	 |j                  |        y|sr|j                  |        |j                  |        y# |j                  |        w xY w# |j                  |        w xY w)
zrewrite TestCase.__call__ to support generative tests
        This is mostly a copy/paste from unittest.py (i.e same
        variable names, same logic, except for the generative tests part)
        N__unittest_skip__F__unittest_skip_why__ r   r   r   r   )defaultTestResultr   r   r   r   rw   r   r   r   r   r   stopTest	startTestr   setUpr   _proceed_generative_proceedtearDown)	r   rh   runconditionoptions
testMethodskip_why
generativestatussuccesss	            r3   __call__zTestCase.__call__  s   
 >++-F  **,
4>>#6>'+UC
&"4>>3JBO SZ 7T 69-NN42MMNP^`a %%d+%Z 8	">>&$**5 OOD! -Z8J((\Jvz: A+>>&$--8 OOD! '!!$' OOD!- %, OOD!s&   A1F, /G AG G ,F?Gtestfuncr   c                    |xj                   dz  c_         d}	  |       D ]  }|r# ||d      st        |t              r ||      s(t        |t        t        f      s|f}|d   }t        |dd        \  }}|xj                   dz  c_         | j                  ||||      }	|	dk(  r|j                  |        d}nd}|j                  s |S  	 |S # | j                  $ r& |j                  | | j                                d}Y |S t        $ r}
|j                  | |
       Y d }
~
|S d }
~
wt        $ r& |j                  | | j                                d}Y |S w xY w)Nr!   TF)skipgeneratorr   )testsRunr   r   r   r   r   r   r   r   failureException
addFailurer   r   r   r   r   )r   rh   r   r   r   r   r   r%   r&   r   r   s              r3   r   zTestCase._proceed_generative  sb    	1	"* XU(S&vy9l6>R !&5$-8$YFay4VABZ@f1$vtT6BQ;%%d+"G#G $$ =<  $$ 	dDOO$56G   	$NN4##
 	  	OOD$//"34G		s0   B.C C C 1EED##.EErF   c                 ~   |xs i }	  ||i | y# | j                   $ r# |j                  | | j                                Y yt        $ r  t        $ r}|j                  | |       Y d}~yd}~wt        $ r}|j                  | |       Y d}~yd}~wt        $ r# |j                  | | j                                Y yw xY w)zproceed the actual test
        returns 0 on success, 1 on failure, 2 on error

        Note: addSuccess can't be called here because we have to wait
        for tearDown to be successfully executed to declare the test as
        successful
        r!   Nr   r   )	r  r  r   rg   r   r   r   r   r   )r   rh   r   r%   r&   r   s         r3   r   zTestCase._proceed  s     2	d%f%  $$ 	dDOO$56  	 	NN4# 	NN4# 	OOD$//"34	s-    /B<B<A**B<6B,B<;B<msgc                 $    |xs d}t        |      )z6mark a generative test as skipped for the <msg> reasonztest was skipped)r   )r   r  s     r3   	innerSkipzTestCase.innerSkip  s    ''s##r:   )   r   )runTestr=   NNN)rF   N)(rD   r   r   r   maxDiffr   r   r7   r   r   r   r   classmethodr   r   r	   r   r   r
   r   r   r   r   r   r   r   r   rc   r   r   r   r   r  rt   version_infor   r   assertCountEqualassertItemsEqualr   r   s   @r3   r   r   Z  s   EG6D3 t  H H  H -c -c - -)8(3- 8 8 C 3 SW &3( 381"h IM%%%-%=E%	%V 9;!%  DJS	5945	
  
B$S $H $
 6!#,,==#,,==r:   r   z4assertItemsEqual is deprecated, use assertCountEqualc                       e Zd Zd Zy)SkippedSuitec                 &    | j                  d       y)$just there to trigger test executionz(doctest module has no DocTestSuite classN)skipped_testr   s    r3   r   zSkippedSuite.test0  s    DEr:   N)rD   r   r   r   rF   r:   r3   r  r  /  s    Fr:   r  c                       e Zd Zd Zd Zy)DocTestFinderc                 x    |j                  dd      | _        t        j                  j                  | g|i | y )NskippedrF   )r   r  doctestr  r   )r   r%   r&   s      r3   r   zDocTestFinder.__init__6  s2    zz)R0&&t=d=f=r:   c                 ~    t        |dd      | j                  v ryt        j                  j	                  | |||||      S )zroverride default _get_test method to be able to skip tests
        according to skipped attribute's value
        rD   r   N)r   r  r  r  	_get_test)r   objrT   moduleglobssource_liness         r3   r  zDocTestFinder._get_test:  s=     3
B'4<<7$$..tS$|\\r:   N)rD   r   r   r   r  rF   r:   r3   r  r  5  s    >]r:   r  c                   *    e Zd ZdZdZdZddZeZd Zy)DocTestztrigger module doctest
    I don't know how to make unittest.main consider the DocTestSuite instance
    without this hack
    z4use stdlib doctest module with unittest API directlyrF   Nc                 H   	 t        | j                        }t        j                  | j                  |      }t
        j                  t        j                  _        t        j                  j                         }	 |j                  |      t        j                  j                          t        j                  j!                  |       S # t        $ r t               }Y w xY w# t        j                  j                          t        j                  j!                  |       w xY w)N)r  )test_finder)r  r  r  DocTestSuiter  rt   r   DocTestCaser   AttributeErrorr  builtins__dict__copyrunclearupdate)r   rh   r   r   findersuiteold_builtinss          r3   r   zDocTest.__call__N  s    	#"4<<8F((&IE69llG3
  ((--/	399V$##%$$\2  	# NE	# ##%$$\2s   AC	 ;C" 	CC"?D!c                      y)r  NrF   r   s    r3   r   zDocTest.testa      r:   r  )	rD   r   r   r   __deprecation_warning__r  r   r+  r   rF   r:   r3   r"  r"  E  s&    
 UG3" C3r:   r"  )	metaclassc                   B    e Zd ZdZd Zd ZddZd Zd Zd Z	d	 Z
d
 Zy)MockConnectionz@fake DB-API 2.0 connexion AND cursor (i.e. cursor() return self)c                 .    g | _         g | _        || _        y r=   )receivedstatesresults)r   r:  s     r3   r   zMockConnection.__init__h  s    r:   c                     | S )zMock cursor methodrF   r   s    r3   cursorzMockConnection.cursorm  s    r:   Nc                 >    | j                   j                  ||f       y)zMock execute methodN)r8  rL   )r   queryr%   s      r3   executezMockConnection.executeq  s    eT]+r:   c                      | j                   d   S )zMock fetchone methodr   r:  r   s    r3   fetchonezMockConnection.fetchoneu  s    ||Ar:   c                     | j                   S )zMock fetchall methodrA  r   s    r3   fetchallzMockConnection.fetchally  s    ||r:   c                 d    | j                   j                  dt        | j                        f       y)zMock commiy methodcommitNr9  rL   rK   r8  r   s    r3   rF  zMockConnection.commit}  s"    Hc$--&89:r:   c                 d    | j                   j                  dt        | j                        f       y)zMock rollback methodrollbackNrG  r   s    r3   rI  zMockConnection.rollback  s"    JDMM(:;<r:   c                      y)zMock close methodNrF   r   s    r3   closezMockConnection.close  r2  r:   r=   )rD   r   r   r   r   r<  r?  rB  rD  rF  rI  rK  rF   r:   r3   r6  r6  e  s-    J
,;= r:   r6  Mockc                  &     t        dd|              S )zcreates an object using params to set attributes
    >>> option = mock_object(verbose=False, index=range(5))
    >>> option.verbose
    False
    >>> option.index
    [0, 1, 2, 3, 4]
    rL  rF   )type)r   s    r3   mock_objectrO    s     $4F#%%r:   pathschrootc                    t               t               }}| D ]y  }t        j                  ||      }t        j                  |      }|dk(  r|j	                  |       E|j	                  t        j
                  |             |j	                  |       { |D ]-  }t        j                  |      rt        j                  |       / |D ]  }t        |d      j                           y)a  Creates directories and files found in <path>.

    :param paths: list of relative paths to files or directories
    :param chroot: the root directory in which paths will be created

    >>> from os.path import isdir, isfile
    >>> isdir('/tmp/a')
    False
    >>> create_files(['a/b/foo.py', 'a/b/c/', 'a/b/c/d/e.py'], '/tmp')
    >>> isdir('/tmp/a')
    True
    >>> isdir('/tmp/a/b/c')
    True
    >>> isfile('/tmp/a/b/c/d/e.py')
    True
    >>> isfile('/tmp/a/b/foo.py')
    True
    r   wN)setr   r^   basenameaddr   isdirr>   makedirsopenrK  )rP  rQ  dirsfilespathfilenamedirpathfilepaths           r3   create_filesr`    s    & %%D 	xx%<<%r>HHTN HHS[[&'IIdO	  !yy!KK !  $Xs!!#$r:   c                       e Zd Zd Zy)
AttrObjectc                 :    | j                   j                  |       y r=   )r)  r-  )r   r&   s     r3   r   zAttrObject.__init__  s    V$r:   N)rD   r   r   r   rF   r:   r3   rb  rb    s    %r:   rb  r%   r&   c                  0     dt         dt         f fd}|S )z#descriptor adding tag to a functionr   r#   c                 D    t        | d      rJ t        i | _        | S )Nr   )rw   r   r   )r   r%   r&   s    r3   descztag.<locals>.desc  s+    4((( $)&)	r:   r
   )r%   r&   rf  s   `` r3   tagrh    s    8   Kr:   versionc                 ,     dt         dt         f fd}|S )zXCompare version of python interpreter to the given one. Skip the test
    if older.
    fr#   c                    j                  d      }	 t        |D cg c]  }t        |       c}      }t        j
                  d d |k  rfd}| j                  |_        |S | S c c}w # t        $ r t        dz        w xY w)N.z0%s is not a correct version : should be X.Y[.Z].r	  c                     | j                  dddj                  D cg c]  }t        |       c}      d       y c c}w )NzNeed at least z' version of python. Current version is rm  )skipTestr^   r7   )r   r%   r&   elementcurrentri  s       r3   new_fz=require_version.<locals>.check_require_version.<locals>.new_f  s5    g)N7#g,)N OQ)Ns   A)splitr   rc   rd   rt   r  rD   )rk  version_elementsvcomparerr  rq  ri  s        @r3   check_require_versionz.require_version.<locals>.check_require_version  s    "==-	[-=>SV>?G ""2A&W ZZENLH ? 	[ORYYZZ	[s   	A/ A*A/ *A/ /Brg  )ri  rw  s   ` r3   require_versionrx    s    
 h ( ! r:   r  c                 ,     dt         dt         f fd}|S )z:Check if the given module is loaded. Skip the test if not.rk  r#   c                 n    	 t               | S # t        $ r fd}| j                  |_        |cY S w xY w)Nc                 .    | j                  dz         y )Nz%s can not be imported.)ro  )r   r%   r&   r  s      r3   rr  z;require_module.<locals>.check_require_module.<locals>.new_f  s    7&@Ar:   )
__import__ImportErrorrD   )rk  rr  r  s     r3   check_require_modulez,require_module.<locals>.check_require_module  s<    		vH 	B ZZENL	s    !44rg  )r  r~  s   ` r3   require_moduler    s    
 
X 
  r:   r=   )Ur   __docformat__
contextlibr   rt   r>   os.pathr\  r   r,   r   shutilr   inspectr   typingr   r   r   r	   r
   r   r   r   mypy_extensionsr   r(  r  logilab.common.deprecationr   r   r   unittest_legacy	functoolsr   logilab.common.decoratorsr   r   r   	unittest2r   r}  rD   __all__DEFAULT_PREFIXESis_generator
__unittestr9   rB   rE   r   rp   ry   r   r   objectr   	TestSuitedictr   r   r   mainr   r   rc   r   r   r   rT  r   r   r   r  r  r  r"  r6  rO  r7   r`  rb  rh  rx  r  rF   r:   r3   <module>r     s  $, &
 & 
 	     ' N N N $   L "  ;t4W$&  ! GV P"#OP
 
 ST#8 # # U#L "2%"\` $H (+ x   X ( .6  	@t @(u ( (x (%S/ eE$t*dSViBW<XZ^<^6_ 2 63 6:M>x   M>`/:
 
F8%% F]G)) ] 3h"2 3@!  ! L&# && &"$S	 "$3 "$4 "$J% %

s 
c 
h 
!S !X !8 3  8  E  WJXUVVWs   4
H H