σ
P'^c           @@  s   d  d l  m Z d  d l Z d  d l Z d  d l m Z d  d l m Z m Z d   Z	 d   Z
 d   Z d e f d	     YZ d S(
   i    (   t   absolute_importN(   t   ExceptionInfo(   t   AppCaset   SkipTestc         C@  s   |  |  S(   N(    (   t   i(    (    sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyt   do_something   s    c           C@  s   t  j d  d  S(   Ni   (   t   timet   sleep(    (    (    sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyt   long_something   s    c         C@  s,   y t  d   Wn t  k
 r' t   SXd  S(   Ns   FOO EXCEPTION(   t   KeyErrorR   (   R   (    (    sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyt   raise_something   s    t   test_TaskPoolc           B@  s#   e  Z d    Z d   Z d   Z RS(   c         C@  sK   y t  d  Wn t k
 r- t d   n Xd d l m } | |  _ d  S(   Nt   multiprocessings   multiprocessing not supportedi    (   t   TaskPool(   t
   __import__t   ImportErrorR   t   celery.concurrency.preforkR   (   t   selfR   (    (    sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyt   setup   s    c         C@  s6   |  j  d  } |  j | j d  |  j | j  d  S(   Ni   (   R   t   assertEqualt   limitt   assertIsNonet   _pool(   R   t   p(    (    sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyt
   test_attrs$   s    c         @  s  |  j  d  } | j   i   t j        f d   } | } | j t d d g d | } | j t d d g d | } | j t d d g d | } |  j | j   d  t	 j
 d	  |  j i d d
 6 j d   |  j | j   t  |  j  j d   t	 j
 d  |  j  d d
 t  |  j  d d
 j j d  |  j | j   d  t	 j
 d	  |  j i d d
 6 j d   | j t d d g d | } |  j | j   d  t	 j
 d	  |  j i d d
 6 j d   | j   d  S(   Ni   c         @  s(   t     } i   | <|   | d <d  S(   Nt	   ret_value(   t   next(   R   t   process(   t   proc_countert
   scratchpad(    sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyt
   mycallback/   s    
t   argsi
   t   callbackt   errbacki   id   g      ΰ?R   i    i   s   FOO EXCEPTIONi  i   i  i   (   s   FOO EXCEPTION(   R   t   startt	   itertoolst   countt   apply_asyncR   R
   R   t   getR   R   t   assertDictContainsSubsett   assertIsInstanceR   t
   assertTruet	   exceptionR   t   stop(   R   R   R   t	   myerrbackt   rest   res2t   res3(    (   R   R   sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyt   x_apply)   s<    
(   t   __name__t
   __module__R   R   R0   (    (    (    sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyR      s   		(   t
   __future__R    R   R#   t   billiard.einfoR   t   celery.tests.caseR   R   R   R   R
   R   (    (    (    sD   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_pool.pyt   <module>   s   			