o
    2³co  ã                   @   s>   d dl Z d dlZd dlZG dd„ deƒZG dd„ de jƒZdS )é    Nc                   @   s   e Zd ZdS )Ú	SomeErrorN)Ú__name__Ú
__module__Ú__qualname__© r   r   úQ/var/www/html/gps/gps/lib/python3.10/site-packages/greenlet/tests/test_tracing.pyr      s    r   c                   @   s&   e Zd Zejrdd„ Zdd„ ZdS dS )ÚTracingTestsc              	      s°   t  ¡ }g ‰ ‡ fdd„}dd„ }dd„ }t  |¡}zt   |¡}| ¡  t   |¡}|  t|j¡ W t  |¡ nt  |¡ w |  ˆ d||ffd||ffd||ffd||ffg¡ d S )	Nc                     s   ˆ   | ¡ d S ©N)Úappend©Úargs©Úactionsr   r   Útrace   s   z1TracingTests.test_greenlet_tracing.<locals>.tracec                   S   s   d S r	   r   r   r   r   r   Údummy   s   z1TracingTests.test_greenlet_tracing.<locals>.dummyc                   S   s   t ƒ ‚r	   )r   r   r   r   r   Údummyexc   s   z4TracingTests.test_greenlet_tracing.<locals>.dummyexcÚswitchÚthrow)ÚgreenletÚ
getcurrentÚsettracer   ÚassertRaisesr   ÚassertEqual)ÚselfÚmainr   r   r   ÚoldtraceÚg1Úg2r   r   r   Útest_greenlet_tracing
   s$   







üz"TracingTests.test_greenlet_tracingc              	      s”   t  ¡ ‰g ‰ ‡ fdd„}‡fdd„}t   |¡}| ¡  t  |¡}z|  t|j¡ |  t  ¡ d ¡ W t  |¡ nt  |¡ w |  ˆ dˆ|ffg¡ d S )Nc                     s   ˆ   | ¡ tƒ ‚r	   )r
   r   r   r   r   r   r   %   s   
z;TracingTests.test_exception_disables_tracing.<locals>.tracec                      s   ˆ   ¡  d S r	   )r   r   )r   r   r   r   (   s   z;TracingTests.test_exception_disables_tracing.<locals>.dummyr   )r   r   r   r   r   r   r   Úgettrace)r   r   r   Úgr   r   )r   r   r   Útest_exception_disables_tracing"   s   



ÿz,TracingTests.test_exception_disables_tracingN)r   r   r   r   ÚGREENLET_USE_TRACINGr   r!   r   r   r   r   r      s
    çr   )ÚunittestÚ	threadingr   Ú	Exceptionr   ÚTestCaser   r   r   r   r   Ú<module>   s
    