ó
ÐH/\c           @` sS  d  d l  m Z m Z m Z d  d l Z d  d l Z d  d l Z d d l m Z d d l m	 Z	 d e
 f d „  ƒ  YZ d e j f d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z e Z e Z e Z e j se j r4e j r4d „  Z d „  Z e j r4e Z e Z q4n  e
 e d „ Z e
 d „ Z d S(   i    (   t   absolute_importt   print_functiont   divisionNi   (   t   sysinfo(   t   sixt   FlakyAssertionErrorc           B` s   e  Z d  Z RS(   s2   Re-raised so that we know it's a known-flaky test.(   t   __name__t
   __module__t   __doc__(    (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyR      s   t	   FlakyTestc           B` s   e  Z d  Z RS(   sŸ   
    A unittest exception that causes the test to be skipped when raised.

    Use this carefully, it is a code smell and indicates an undebugged problem.
    (   R   R   R   (    (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyR	   #   s   t   FlakyTestRaceConditionc           B` s   e  Z d  Z RS(   sP   
    Use this when the flaky test is definitely caused by a race condition.
    (   R   R   R   (    (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyR
   *   s   t   FlakyTestTimeoutc           B` s   e  Z d  Z RS(   sY   
    Use this when the flaky test is definitely caused by an
    unexpected timeout.
    (   R   R   R   (    (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyR   /   s   t   FlakyTestCrashesc           B` s   e  Z d  Z RS(   s3   
    Use this when the test sometimes crashes.
    (   R   R   R   (    (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyR   5   s   c           C` s1   t  j t t t j ƒ  d ƒ t j ƒ  d ƒ d  S(   Ni   i   (   R   t   reraiseR   t   syst   exc_info(    (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyt   reraiseFlakyTestRaceCondition:   s    	c          C` s=   t  t j ƒ  d ƒ }  t j t t |  ƒ t j ƒ  d ƒ d  S(   Ni   i   (   t   strR   R   R   R   R
   (   t   msg(    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyR   E   s    		c          C` s=   t  t j ƒ  d ƒ }  t j t t |  ƒ t j ƒ  d ƒ d  S(   Ni   i   (   R   R   R   R   R   R   (   R   (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyt   reraiseFlakyTestTimeoutY   s    		c         ` s   ‡  ‡ f d †  } | S(   Nc         ` s(   t  j ˆ  ƒ ‡ ‡ ‡  f d †  ƒ } | S(   Nc          ` s-   y ˆ |  Œ  Wn ˆ k
 r( ˆ  ƒ  n Xd  S(   N(    (   t   args(   t   _funct   exc_kindt   f(    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyt   mg   s    (   t	   functoolst   wraps(   R   R   (   R   R   (   R   s3   lib/python2.7/site-packages/gevent/testing/flaky.pyt   wrapperf   s    $(    (   R   R   R   (    (   R   R   s3   lib/python2.7/site-packages/gevent/testing/flaky.pyt   reraises_flaky_timeoutd   s    	c         C` s   t  |  d t ƒS(   NR   (   R   R   (   R   (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyt   reraises_flaky_race_conditionq   s    (   t
   __future__R    R   R   R   R   t   unittestt    R   R   t   AssertionErrorR   t   SkipTestR	   R
   R   R   R   R   t"   reraiseFlakyTestRaceConditionLibuvt   reraiseFlakyTestTimeoutLibuvt   RUNNING_ON_CIt   PYPYt   WINt   LIBUVR   R   (    (    (    s3   lib/python2.7/site-packages/gevent/testing/flaky.pyt   <module>   s,   				