B
    ÐH/\8  ã               @   sT   d dl mZ d dlZG dd„ dejƒZdd„ ZG dd„ dejƒZe	dkrPe 
¡  dS )	é    Nc               @   s   e Zd ZdS )ÚExpectedErrorN)Ú__name__Ú
__module__Ú__qualname__© r   r   ú:lib/python3.7/site-packages/gevent/tests/test__issue607.pyr      s   r   c               C   s   t  d¡ d S )Niç  )ÚgeventZsleepr   r   r   r   Úf
   s    r	   c               @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚTestKillWithExceptionc             C   s6   t  t¡}| ¡  | ¡ st‚t| ¡ t jƒs2t‚d S )N)	r   Úspawnr	   ÚkillÚ
successfulÚAssertionErrorÚ
isinstanceÚgetZGreenletExit)ÚselfÚgr   r   r   Útest_kill_without_exception   s    
z1TestKillWithException.test_kill_without_exceptionc             C   sP   t  t¡}| t¡ | ¡ r t‚|  t|j¡ |j	d ks<t‚t
|jtƒsLt‚d S )N)r   r   r	   r   r   r   r   ÚassertRaisesr   Úvaluer   Ú	exception)r   r   r   r   r   Útest_kill_with_exception   s    

z.TestKillWithException.test_kill_with_exceptionc             C   sZ   t  t¡}| d¡ | t¡ | ¡ r*t‚|  t|j	¡ |j
d ksFt‚t|jtƒsVt‚d S )Nr   )r   r   r	   Újoinr   r   r   r   r   r   r   r   r   )r   r   r   r   r   Ú&test_kill_with_exception_after_started   s    


z<TestKillWithException.test_kill_with_exception_after_startedN)r   r   r   r   r   r   r   r   r   r   r
      s   	r
   Ú__main__)Zgevent.testingZtestingZ	greentestr   ZExpectedExceptionr   r	   ZTestCaser
   r   Úmainr   r   r   r   Ú<module>   s   