ó
úR‹_c           @  s¼   d  d l  m 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 „  Z d e j	 f d „  ƒ  YZ
 e ƒ  Z d e f d „  ƒ  YZ d „  Z e d	 k r¸ e ƒ  n  d S(
   iÿÿÿÿ(   t   print_functionNc          O  s   d  S(   N(    (   t   _argst   _kwargs(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyt
   myfunction   s    t   RENormalizingOutputCheckerc           B  s    e  Z d  Z d „  Z d „  Z RS(   sS   
    Pattern-normalizing output checker. Inspired by one used in zope.testing.
    c         C  s5   g  | D]! \ } } t  j | j | ƒ ^ q |  _ d  S(   N(   t	   functoolst   partialt   subt   transformers(   t   selft   patternst   ret   replacement(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyt   __init__   s    c         C  sU   | | k r t  Sx) |  j D] } | | ƒ } | | ƒ } q Wt j j |  | | | ƒ S(   N(   t   TrueR   t   doctestt   OutputCheckert   check_output(   R	   t   wantt   gott   optionflagst   transformer(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyR      s    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyR      s   	t   Modulesc           B  s2   e  Z d  „  Z d „  Z d „  Z e Z d „  Z RS(   c         C  sY   d d l  m } | |  _ t ƒ  |  _ x- | d t ƒ D] \ } } |  j | | ƒ q5 Wd  S(   Niÿÿÿÿ(   t   walk_modulest	   recursive(   t   gevent.testingR   t   allowed_modulest   sett   modulesR   t
   add_module(   R	   R   R   t   patht   module(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyR   *   s
    	c         C  sF   |  j  r | |  j  k r d  S| t k r, d  S|  j j | | f ƒ d  S(   N(   R   t   FORBIDDEN_MODULESR   t   add(   R	   t   nameR!   (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyR    3   s
    c         C  s   t  |  j ƒ S(   N(   t   boolR   (   R	   (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyt   __bool__:   s    c         C  s   t  |  j ƒ S(   N(   t   iterR   (   R	   (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyt   __iter__?   s    (   R   R   R   R    R'   t   __nonzero__R)   (    (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyR   (   s
   				c          C  s:  t  j ƒ  }  d t  j d <d d  l } d d l m } d d l m } d d l m } | j rq t	 j
 d h ƒ n  z´t j d } t j j d	 ƒ i t d
 6| d 6| d 6} t | ƒ } | sÛ t j d d j | ƒ ƒ n  t j ƒ  } t t j d ƒ d f t j d ƒ d f t j d ƒ d f f ƒ }	 d }
 d } xº t | ƒ D]¬ \ } } t | d ƒ  } | j ƒ  } Wd  QXt j d | t j ƒ rBt j | d | d |	 ƒ} t | j  ƒ } | j! d | | | ƒ | j" | ƒ | d 7} |
 | 7}
 qBqBW| j! d |
 | ƒ t j# d d ƒ } | j$ | ƒ Wd  t  j% |  ƒ Xd  S(   Nt   1t   PURE_PYTHONiÿÿÿÿ(   t   socket(   t   util(   t   sysinfos   gevent.subprocessi   t   .R   t   geventR-   s   No modules found matching %st    s@   ls: cannot access 'non_existent_file': No such file or directorys0   ls: non_existent_file: No such file or directorys   b(".*?")s   \1s   b('.*?')i    t   rbs   ^\s*>>> t
   extraglobst   checkers   %s (from %s): %s testss   Total: %s tests in %s modulest	   verbosityi   (&   t   ost   getcwdt   environR1   R-   R   R.   R/   t   WINR#   t   updatet   syst   argvR!   t   appendR   R   t   exitt   joint   unittestt	   TestSuiteR   R   t   compilet   sortedt   opent   readt   searcht   MR   t   DocTestSuitet   lent   _testst   logt   addTestt   TextTestRunnert   runt   chdir(   t   cwdR1   R-   R.   R/   R   t   globsR   t   suiteR5   t   tests_countt   modules_countt   mR!   t   ft   contentst   st
   test_countt   runner(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyt   mainC   sT    	

t   __main__(   t
   __future__R    R   R   R7   R   R<   RA   R   R   R   R   R#   t   objectR   R\   R   (    (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__doctests.pyt   <module>   s   			A