ó
ÓnùWc           @   sŒ   d  d l  m Z d  d l m Z d  d l Z d  d l Td  d l m Z d  d l m Z m	 Z	 d e f d „  ƒ  YZ
 d	 e f d
 „  ƒ  YZ d S(   iÿÿÿÿ(   t   Command(   t   DistutilsOptionErrorN(   t   *(   t   _namespace_packages(   t
   TestLoadert   maint   ScanningLoaderc           B   s   e  Z d  „  Z RS(   c         C   s&  g  } | j  d k r1 | j t j |  | ƒ ƒ n  t | d ƒ rV | j | j ƒ  ƒ n  t | d ƒ rû x“ t | j  d ƒ D]| } | j d ƒ r± | d k r± | j  d | d  } n- t | j  | d	 ƒ rx | j  d | } n qx | j |  j	 | ƒ ƒ qx Wn  t
 | ƒ d
 k r|  j | ƒ 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.
        s   setuptools.tests.doctestt   additional_testst   __path__t    s   .pys   __init__.pyt   .iýÿÿÿs   /__init__.pyi   i    N(   t   __name__t   appendR   t   loadTestsFromModulet   hasattrR   t   resource_listdirt   endswitht   resource_existst   loadTestsFromNamet   lent
   suiteClass(   t   selft   modulet   testst   filet	   submodule(    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyR   
   s"    (   R   t
   __module__R   (    (    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyR      s   t   testc           B   sM   e  Z d  Z d Z d d g Z d „  Z d	 „  Z d
 „  Z d „  Z 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')c         C   s   d  |  _ d  |  _ d  |  _ d  S(   N(   t   Nonet
   test_suitet   test_modulet   test_loader(   R   (    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyt   initialize_options7   s    		c         C   sÒ   |  j  d  k rC |  j d  k r0 |  j j  |  _  q[ |  j d |  _  n |  j r[ t d ƒ ‚ n  |  j  g |  _ |  j r‰ |  j j d d ƒ n  |  j d  k r³ t	 |  j d d  ƒ |  _ n  |  j d  k rÎ d |  _ n  d  S(   Ns   .test_suites1   You may specify a module or a suite, but not bothi    s	   --verboseR!   s&   setuptools.command.test:ScanningLoader(
   R   R   R    t   distributionR   t	   test_argst   verboset   insertR!   t   getattr(   R   (    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyt   finalize_options=   s    		c         C   s‹  t  j d k r¥ t |  j d t ƒ r¥ |  j d d d ƒ|  j d ƒ |  j d ƒ } t | j	 ƒ } |  j d d | ƒ|  j d ƒ |  j d d d ƒ|  j d ƒ n- |  j d ƒ |  j d d d	 ƒ|  j d ƒ |  j d ƒ } t  j
 } t  j j ƒ  } zX t  j
 j d t | j ƒ ƒ t j ƒ  t d
 „  ƒ t d | j | j f ƒ | ƒ  Wd  | t  j
 (t  j j ƒ  t  j j | ƒ t j ƒ  Xd  S(   Ni   t   use_2to3t   build_pyt   inplacei    t   egg_infot   egg_baset	   build_exti   c         S   s
   |  j  ƒ  S(   N(   t   activate(   t   dist(    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyt   <lambda>t   s    s   %s==%s(   i   (   t   syst   version_infoR'   R#   t   Falset   reinitialize_commandt   run_commandt   get_finalized_commandt   normalize_patht	   build_libt   patht   modulest   copyR&   R-   t   working_sett   __init__t   add_activation_listenert   requiret   egg_namet   egg_versiont   cleart   update(   R   t   funct   bpy_cmdt
   build_patht   ei_cmdt   old_patht   old_modules(    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyt   with_project_on_sys_pathT   s2    $


c         C   sª   |  j  j r% |  j  j |  j  j ƒ n  |  j  j rJ |  j  j |  j  j ƒ n  |  j r¦ d j |  j ƒ } |  j r‚ |  j d | ƒ q¦ |  j d | ƒ |  j	 |  j
 ƒ 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   announceRK   t	   run_tests(   R   t   cmd(    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyt   run~   s    		c         C   s2  d d  l  } t j d	 k r× t |  j d t ƒ r× |  j d j d ƒ d } | t k r× g  } | t j	 k r{ | j
 | ƒ n  | d 7} x0 t j	 D]% } | j | ƒ r | j
 | ƒ q q Wt t t j	 j | ƒ ƒ q× n  t j d |  j ƒ } | j d t ƒ } | ƒ  } | j d  d  | j g |  j d | ƒd  S(
   Niÿÿÿÿi   R)   R
   i    s   x=R@   t
   testLoader(   i   (   t   unittestR2   R3   R'   R#   R4   R$   t   splitR   R;   R   t
   startswitht   listt   mapt   __delitem__t
   EntryPointt   parseR!   t   loadR   R   t   __file__(   R   RW   R   t   del_modulest   namet	   loader_ept   loader_classt   cks(    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyRS      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')(
   R   R   t   __doc__t   descriptiont   user_optionsR"   R(   RK   RU   RS   (    (    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyR   +   s    				*	(   t
   setuptoolsR    t   distutils.errorsR   R2   t   pkg_resourcesR   RW   R   R   R   R   (    (    (    s>   /var/www/html/venv/build/setuptools/setuptools/command/test.pyt   <module>   s   
#