Ñò
~¸Uc           @   sÒ   d  d k  l Z d  d k l Z d  d k Z d  d k Z d  d k l Z l Z l Z l	 Z	 l
 Z
 l Z l Z l Z d  d k l Z d  d k l Z d  d k l Z d e f d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   DistutilsOptionError(   t
   TestLoaderN(   t   resource_listdirt   resource_existst   normalize_patht   working_sett   _namespace_packagest   add_activation_listenert   requiret
   EntryPoint(   t   Command(   t   PY3(   t   unittest_maint   ScanningLoaderc           B   s   e  Z d  „  Z RS(   c         C   s  g  } | i  t i |  | ƒ ƒ t | d ƒ o | i  | i ƒ  ƒ n t | d ƒ oœ x™ t | i d ƒ D] } | i d ƒ o& | d j o | i d | d  } n0 t | i | d ƒ o | i d | } n qi | i  |  i	 | ƒ ƒ qi Wn t
 | ƒ d	 j o |  i | ƒ S| d
 Sd S(   s  Return a suite of all tests cases contained in the given module

        If the module is a package, load tests from all the modules in it.
        If the module has an ``additional_tests`` function, call it and add
        the return value to the tests.
        t   additional_testst   __path__t    s   .pys   __init__.pyt   .iýÿÿÿs   /__init__.pyi   i    N(   t   appendR   t   loadTestsFromModulet   hasattrR   R   t   __name__t   endswithR   t   loadTestsFromNamet   lent
   suiteClass(   t   selft   modulet   testst   filet	   submodule(    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyR      s      (   R   t
   __module__R   (    (    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyR      s   t   testc           B   s_   e  Z d  Z d Z d d d g Z d „  Z d „  Z d „  Z d „  Z d „  Z	 e
 d „  ƒ Z RS(   s.   Command to run unit tests after in-place builds#   run unit tests after in-place builds   test-module=t   ms$   Run 'test_suite' in specified modules   test-suite=t   ss1   Test suite to run (e.g. 'some_module.test_suite')s   test-runner=t   rs   Test runner to usec         C   s(   d  |  _ d  |  _ d  |  _ d  |  _ d  S(   N(   t   Nonet
   test_suitet   test_modulet   test_loadert   test_runner(   R   (    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyt   initialize_options9   s    			c         C   s
  |  i  d  j o7 |  i d  j o |  i i  |  _  qa |  i d |  _  n |  i o t d ƒ ‚ n |  i  g |  _ |  i o |  i i d d ƒ n |  i d  j o t	 |  i d d  ƒ |  _ n |  i d  j o d |  _ n |  i
 d  j o t	 |  i d d  ƒ |  _
 n d  S(   Ns   .test_suites1   You may specify a module or a suite, but not bothi    s	   --verboseR'   s&   setuptools.command.test:ScanningLoaderR(   (   R%   R$   R&   t   distributionR    t	   test_argst   verboset   insertR'   t   getattrR(   (   R   (    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyt   finalize_options?   s     

c         C   s‹  t  o t |  i d t ƒ } | o‚ |  i d d d ƒ|  i d ƒ |  i d ƒ } t | i ƒ } |  i d d | ƒ|  i d ƒ |  i d d d ƒ|  i d ƒ n. |  i d ƒ |  i d d d ƒ|  i d ƒ |  i d ƒ } t	 i
 } t	 i i ƒ  } zX t	 i
 i d t | i ƒ ƒ t i ƒ  t d	 „  ƒ t d
 | i | i f ƒ | ƒ  Wd  | t	 i
 (t	 i i ƒ  t	 i i | ƒ t i ƒ  Xd  S(   Nt   use_2to3t   build_pyt   inplacei    t   egg_infot   egg_baset	   build_exti   c         S   s
   |  i  ƒ  S(    (   t   activate(   t   dist(    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyt   <lambda>x   s    s   %s==%s(   R   R.   R*   t   Falset   reinitialize_commandt   run_commandt   get_finalized_commandR   t	   build_libt   syst   patht   modulest   copyR-   R4   R   t   __init__R   R   t   egg_namet   egg_versiont   cleart   update(   R   t   funct	   with_2to3t   bpy_cmdt
   build_patht   ei_cmdt   old_patht   old_modules(    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyt   with_project_on_sys_pathV   s4    


c         C   s²   |  i  i o |  i  i |  i  i ƒ n |  i  i o |  i  i |  i  i ƒ n |  i oV d i |  i ƒ } |  i o |  i d | ƒ q® |  i d | ƒ |  i	 |  i
 ƒ n d  S(   Nt    s    skipping "unittest %s" (dry run)s   running "unittest %s"(   R*   t   install_requirest   fetch_build_eggst   tests_requireR%   t   joinR+   t   dry_runt   announceRN   t	   run_tests(   R   t   cmd(    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyt   run   s    	

c         C   s  t  oÄ t |  i d t ƒ o® |  i d i d ƒ d } | t j oƒ g  } | t i j o | i	 | ƒ n | d 7} x2 t i D]' } | i
 | ƒ o | i	 | ƒ q q Wt t t i i | ƒ ƒ qË n t d  d  t i g |  i d |  i |  i ƒ d |  i |  i ƒ ƒd  S(   NR0   iÿÿÿÿR   i    t
   testLoadert
   testRunner(   R   R.   R*   R9   R+   t   splitR   R>   R@   R   t
   startswitht   listt   mapt   __delitem__R   R$   t   unittestt   __file__t   _resolve_as_epR'   R(   (   R   R   t   del_modulest   name(    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyRV      s     

 !c         C   s2   |  d j o d St i d |  ƒ } | i ƒ  ƒ  S(   su   
        Load the indicated attribute value, called, as a as if it were
        specified as an entry point.
        Ns   x=(   R$   R	   t   parset   resolve(   t   valt   parsed(    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyRb   ¦   s    (   s   test-module=R!   s$   Run 'test_suite' in specified module(   s   test-suite=R"   s1   Test suite to run (e.g. 'some_module.test_suite')(   s   test-runner=R#   s   Test runner to use(   R   R   t   __doc__t   descriptiont   user_optionsR)   R/   RN   RX   RV   t   staticmethodRb   (    (    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyR    -   s    				+		(   t   distutils.errorsR    R`   R   R>   t   pkg_resourcesR   R   R   R   R   R   R   R	   t
   setuptoolsR
   t   setuptools.compatR   t   setuptools.py31compatR   R   R    (    (    (    s;   /usr/lib/python2.6/site-packages/setuptools/command/test.pyt   <module>   s   :