ó
ÐH/\c           @   s»   d  d l  Z  d  d l Z d  d l j Z d  d l m Z d  d l m Z e j s] e j	 ƒ  n  d e
 f d „  ƒ  YZ d „  Z d „  Z d e j f d	 „  ƒ  YZ e d
 k r· e j ƒ  n  d S(   iÿÿÿÿN(   t   six(   t   ExpectedExceptiont   RawExceptionc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s:   lib/python2.7/site-packages/gevent/tests/test__exc_info.pyR   
   s   c         C   s.   t  j ƒ  d k s$ t t  j ƒ  ƒ ‚ |  ‚ d  S(   N(   NNN(   t   syst   exc_infot   Nonet   AssertionError(   t   err(    (    s:   lib/python2.7/site-packages/gevent/tests/test__exc_info.pyt   hello   s    $c           C   s,   y t  t d ƒ ƒ Wn t k
 r' n Xd  S(   Ns   expected exception in hello(   R
   t   ExpectedError(    (    (    s:   lib/python2.7/site-packages/gevent/tests/test__exc_info.pyt   hello2   s    t   Testc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s´   t  d ƒ } t d ƒ } y
 | ‚ Wn‹ t  k
 r¯ |  j ƒ  t j t | ƒ } | j ƒ  |  j t | ƒ |  j | j	 t ƒ y ‚  Wq° t
 j ƒ  d } |  j | | ƒ q° Xn Xd  S(   NR
   s   expected exception in helloi   (   R   R   t   expect_one_errort   geventt   spawnR
   t   joint   assert_errort   assertIsInstancet	   exceptionR   R   t   assertIs(   t   selft   errort   expected_errort   gt   ex(    (    s:   lib/python2.7/site-packages/gevent/tests/test__exc_info.pyt   test1   s    


c         C   s^   t  j ƒ  j j d ƒ } | j t ƒ z' t  j d ƒ |  j t j	 ƒ  d ƒ Wd  | j ƒ  Xd  S(   Ni    gš™™™™™¹?(   NNN(   R   t   get_hubt   loopt   timert   startR   t   sleept   assertEqualR   R   R   t   close(   R   R   (    (    s:   lib/python2.7/site-packages/gevent/tests/test__exc_info.pyt   test2.   s    (   R   R   R   R#   (    (    (    s:   lib/python2.7/site-packages/gevent/tests/test__exc_info.pyR      s   	t   __main__(   R   R   t   gevent.testingt   testingt	   greentestR    R   R   t   PY3t	   exc_cleart	   ExceptionR   R
   R   t   TestCaseR   R   t   main(    (    (    s:   lib/python2.7/site-packages/gevent/tests/test__exc_info.pyt   <module>   s   			