o
    ÑtPfa  ã                   @   sŒ   d dl Z d dlZd dlmZ d dlmZ d dlmZ ejr!e 	¡  G dd„ de
ƒZdd„ Zdd	„ ZG d
d„ dejƒZedkrDe ¡  dS dS )é    N)Úsix)ÚExpectedExceptionc                   @   s   e Zd ZdS )ÚRawExceptionN)Ú__name__Ú
__module__Ú__qualname__© r   r   ú\/var/www/html/humari/django-venv/lib/python3.10/site-packages/gevent/tests/test__exc_info.pyr   
   s    r   c                 C   s   t  ¡ dksJ t  ¡ ƒ‚| ‚)N©NNN)ÚsysÚexc_info)Úerrr   r   r	   Úhello   s   r   c                   C   s(   z	t tdƒƒ W d S  ty   Y d S w )Núexpected exception in hello)r   ÚExpectedErrorr   r   r   r	   Úhello2   s
   ÿr   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚTestc              
   C   s„   t dƒ}tdƒ}z|‚ t yA   |  ¡  t t|¡}| ¡  |  t|¡ |  |j	t¡ z‚    t
 ¡ d }|  ||¡ Y Y d S w )Nr   r   é   )r   r   Úexpect_one_errorÚgeventÚspawnr   ÚjoinÚassert_errorÚassertIsInstanceÚ	exceptionr   r   ÚassertIs)ÚselfÚerrorÚexpected_errorÚgÚexr   r   r	   Útest1   s    õz
Test.test1c                 C   sN   t  ¡ j d¡}| t¡ zt  d¡ |  t 	¡ d¡ W | 
¡  d S | 
¡  w )Nr   gš™™™™™¹?r
   )r   Úget_hubÚloopÚtimerÚstartr   ÚsleepÚassertEqualr   r   Úclose)r   r$   r   r   r	   Útest2.   s   

z
Test.test2N)r   r   r   r!   r)   r   r   r   r	   r      s    r   Ú__main__)r   r   Úgevent.testingÚtestingÚ	greentestr   r   r   ÚPY2Ú	exc_clearÚ	Exceptionr   r   r   ÚTestCaser   r   Úmainr   r   r   r	   Ú<module>   s    ÿ