ó
ÐH/\c           @   s­   d  d l  m Z e j ƒ  d  d l Z  e  j j ƒ  d k sG t d ƒ ‚ d  d l  Z  d  d l j	 Z
 d  d l Z d „  Z d e
 j f d „  ƒ  YZ e d k r© e
 j ƒ  n  d S(   iÿÿÿÿ(   t   monkeyNs&   monkey.patch_all() should not init hubc           C   s   t  j ƒ  t j d ƒ d  S(   Ngš™™™™™É?(   t	   threadingt   currentThreadt   geventt   sleep(    (    (    s;   lib/python2.7/site-packages/gevent/tests/test__threading.pyt   helper   s    
t   Testc           B   s2   e  Z d  „  Z d „  Z e j d ƒ d „  ƒ Z RS(   c         C   s¡   t  t j ƒ } | t ƒ } t j d ƒ |  j t  t j ƒ | d ƒ y | j ƒ  Wn. t k
 rƒ x | j	 s| t j ƒ  qf W~ n X|  j t  t j ƒ | ƒ d  S(   Ngš™™™™™¹?i   (
   t   lenR   t   _activeR   R   R   t   assertEqualt   joint   AttributeErrort   dead(   t   selft   spawnt   beforet   g(    (    s;   lib/python2.7/site-packages/gevent/tests/test__threading.pyt   _do_test   s    c         C   s   |  j  t j ƒ d  S(   N(   R   R   R   (   R   (    (    s;   lib/python2.7/site-packages/gevent/tests/test__threading.pyt   test_cleanup_gevent*   s    s-   weakref is not cleaned up in a timely fashionc         C   s   |  j  t j ƒ d  S(   N(   R   R   t	   spawn_raw(   R   (    (    s;   lib/python2.7/site-packages/gevent/tests/test__threading.pyt   test_cleanup_raw-   s    (   t   __name__t
   __module__R   R   t	   greentestt
   skipOnPyPyR   (    (    (    s;   lib/python2.7/site-packages/gevent/tests/test__threading.pyR      s   		t   __main__(   R   R    t	   patch_allt
   gevent.hubt   hubt   _get_hubt   Nonet   AssertionErrort   gevent.testingt   testingR   R   R   t   TestCaseR   R   t   main(    (    (    s;   lib/python2.7/site-packages/gevent/tests/test__threading.pyt   <module>   s    
!	 