o
    JXhu                     @   s   	 d dl Z d dl mZ d dlZd dlZd dlZdZeeZdd ZG dd de j	Z
G dd	 d	e j	ZG d
d de j	ZG dd de j	ZedkrPe   dS dS )    N)mockzv^<(?P<class>.*?) object at (?P<address>.*?)\[(?P<extras>(set|unset|locked|unlocked)(, value:\d)?(, waiters:\d+)?)\]>\Zc                   C   s   t d  d S N)asyncioZset_event_loop_policy r   r   F/opt/python-3.10.19/usr/lib/python3.10/test/test_asyncio/test_locks.pytearDownModule   s   r   c                   @   sl   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd ZdS )	LockTestsc                    sl   t  }| t|d | tt| | I d H  | t|d | tt| d S )Nz[unlocked]>	[locked]>)r   Lock
assertTruereprendswithRGX_REPRmatchacquireselflockr   r   r   	test_repr   s   zLockTests.test_reprc                    s   t   | t t j fdd}W d    n1 sw   Y  | td | I d H  W d    n1 s:w   Y  |    d S )Nc                   3        E d H S r   r   r   r   r   r   acquire_lock&      
z)LockTests.test_lock.<locals>.acquire_lockobject is not iterable)	r   r
   assertWarnsDeprecationWarning	coroutineassertRaisesRegex	TypeErrorassertFalselockedr   r   r   r   r   	test_lock"   s   zLockTests.test_lockc              	      sp   t jt jt jt jt jg}t  }|D ]"}| td|j	 d ||d W d    n1 s0w   Y  qd S )Nz4As of 3.10, the \*loop\* parameter was removed from z$\(\) since it is no longer necessaryloop)
r   r
   	ConditionEvent	SemaphoreBoundedSemaphoreget_running_loopr   r   __name__)r   Zprimitives_clsr$   clsr   r   r   &test_lock_doesnt_accept_loop_parameter2   s&   z0LockTests.test_lock_doesnt_accept_loop_parameterc                    s   t  t  t  t  g} t t j fdd}W d    n1 s(w   Y  |D ]}||I d H   |	  q/d S )Nc              	   3   s    t dE d H   |    td | E d H  W d    n1 s'w   Y  W d    n1 s6w   Y   |   d S )N{Gz?r   )r   sleepr   r    r   r   r   r   r   r   testN   s   z3LockTests.test_lock_by_with_statement.<locals>.test)
r   r
   r%   r'   r(   r   r   r   r   r    )r   Z
primitivesr0   r   r   r/   r   test_lock_by_with_statementE   s   z%LockTests.test_lock_by_with_statementc                    sx  t   g }|   I d H   fdd} fdd} fdd}t ||}t ||}t dI d H  | g |    t dI d H  | dg| t dI d H  | dg| t ||}   t dI d H  | dd	g|    t dI d H  | g d
| | |  | |	  | |  | |	  | |  | |	  d S )Nc                          I d H r| d dS N   Tr   appendresultr   r   r   c1d      
z"LockTests.test_acquire.<locals>.c1c                    r2   N   Tr5   r7   r   r   r   c2i   r:   z"LockTests.test_acquire.<locals>.c2c                    r2   N   Tr5   r7   r   r   r   c3n   r:   z"LockTests.test_acquire.<locals>.c3r   r4   r<   r4   r<   r?   )
r   r
   r   r   create_taskr.   assertEqualreleasedoner8   r   r8   r9   r=   r@   t1t2t3r   r   r   test_acquire^   s:   zLockTests.test_acquirec                    s   t  }| | I d H  t | }t  |j | t j	 |I d H  W d    n1 s4w   Y  | 
|j d S r   )r   r
   r   r   rB   r)   	call_sooncancelassertRaisesCancelledErrorr   _waiters)r   r   Ztaskr   r   r   test_acquire_cancel   s   zLockTests.test_acquire_cancelc                    s"  t    fdd}t   }t |d|}t dI d H  |    t |dd }t dI d H  | t	 j
d t |dd }t dI d H  | t	 j
d |d  |  |  j
d   t dI d H  |    | |  | |  |I d H  d S )	Nc                    sJ      I d H  z|d ur|I d H  W    d S W    d S    w r   )r   rD   )nameZblockerr   r   r   lockit   s   z*LockTests.test_cancel_race.<locals>.lockitAr   Br4   Cr<   )r   r
   r)   Zcreate_futurerB   r.   r   r    rC   lenrO   
set_resultrL   	cancelledr   rE   )r   rR   fatatbtcr   r   r   test_cancel_race   s*   
zLockTests.test_cancel_racec                    s  t  }t  dd  fdd}fdd} I d H  t | t | }t | }t dI d H  || | t j I d H  W d    n1 sXw   Y  | 	d | 	 d | 
 or|  |  t dI d H  | 
|  d S )Nr   c                      s$    d7    I d H  d7 d S Nr4   )r   r   )
call_countr   
lock_countr   r   rR      s   z2LockTests.test_cancel_release_race.<locals>.lockitc                      s         d S r   )rL   rD   r   )r   rG   r   r   trigger   s   z3LockTests.test_cancel_release_race.<locals>.triggerr4   r?   )r   r)   r
   r   rB   r.   rK   rM   rN   rC   r   rX   rE   rL   )r   r$   rR   ra   rH   rI   r   )r_   r   r`   rG   r   test_cancel_release_race   s,   
z"LockTests.test_cancel_release_racec                    s   t  }| I d H  | |  t | }t dI d H  | t|j	d t | }|
  |  t dI d H  | |  | |  |I d H  d S )Nr   r4   )r   r
   r   r   r    rB   r.   rC   rV   rO   rL   rD   rX   )r   r   r[   r\   r   r   r   test_finished_waiter_cancelled   s   z(LockTests.test_finished_waiter_cancelledc                    s   t  }| t|j d S r   )r   r
   rM   RuntimeErrorrD   r   r   r   r   test_release_not_acquired  s   z#LockTests.test_release_not_acquiredc                    @   t  }| I d H  | |  |  | |  d S r   )r   r
   r   r   r    rD   r   r   r   r   r   test_release_no_waiters     z!LockTests.test_release_no_waitersc              	      p   t  }| |  |4 I d H  | |  W d   I d H  n1 I d H s*w   Y  | |  d S r   )r   r
   r   r    r   r   r   r   r   test_context_manager  s   (zLockTests.test_context_managerN)r*   
__module____qualname__r   r"   r,   r1   rJ   rP   r]   rb   rc   re   rg   rj   r   r   r   r   r      s    	3
/-r   c                   @   s<   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd ZdS )
EventTestsc                 C   s   t  }| t|d tt|}| |dd |	  | t|d | tt| |j
t  | dt|v  | tt| d S )Nz[unset]>extrasZunsetz[set]>	waiters:1)r   r&   r   r   r   r   r   rC   groupsetrO   r6   r   Mock)r   evr   r   r   r   r   '  s   zEventTests.test_reprc                    s  t   |    g } fdd} fdd} fdd}t ||}t ||}t dI d H  | g | t ||}   t dI d H  | g d| | |	  | 
|  | |	  | 
|  | |	  | 
|  d S )	Nc                    "      I d H r| d d S d S r^   waitr6   r7   rs   r   r   r9   ;     z EventTests.test_wait.<locals>.c1c                    rt   )Nr<   ru   r7   rw   r   r   r=   ?  rx   z EventTests.test_wait.<locals>.c2c                    rt   )Nr?   ru   r7   rw   r   r   r@   C  rx   z EventTests.test_wait.<locals>.c3r   )r?   r4   r<   )r   r&   r   is_setrB   r.   rC   rq   r   rE   ZassertIsNoner8   rF   r   rw   r   	test_wait5  s*   zEventTests.test_waitc                    s.   t  }|  | I d H }| | d S r   )r   r&   rq   rv   r   )r   rs   resr   r   r   test_wait_on_setZ  s
   zEventTests.test_wait_on_setc                    sn   t  }t | }t  |j | t j |I d H  W d    n1 s*w   Y  | 	|j
 d S r   )r   r&   rB   rv   r)   rK   rL   rM   rN   r   rO   )r   rs   rv   r   r   r   test_wait_cancela  s   zEventTests.test_wait_cancelc                    sH   t  }| |  |  | |  |  | |  d S r   )r   r&   r   ry   rq   r   clear)r   rs   r   r   r   
test_clearj  s   zEventTests.test_clearc                    s   t   g } fdd}t ||}t dI d H  | g |       |          | dt	 j
 t dI d H  | dg| | dt	 j
 | |  | |  d S )Nc                    r2   r3   ru   r7   rw   r   r   r9   x  r:   z.EventTests.test_clear_with_waiters.<locals>.c1r   r4   )r   r&   rB   r.   rC   rq   r~   r   ry   rV   rO   r   rE   r8   r   r8   r9   tr   rw   r   test_clear_with_waiterst  s$   z"EventTests.test_clear_with_waitersN)	r*   rk   rl   r   rz   r|   r}   r   r   r   r   r   r   rm   %  s    %	
rm   c                   @   s   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!S )"ConditionTestsc                    s  t   g } fdd} fdd} fdd}t ||}t ||}t ||}t dI d H  | g | |    |   I d H   	  t dI d H  | g | |     
  t dI d H  | dg| |     	d	 t dI d H  | dg| |     
  t dI d H  | dd	g| |     
  t dI d H  | g d
| |    | |  | |  | |  | |  | |  | |  d S )Nc                    ,      I d H    I d H r| d dS r3   r   rv   r6   r7   condr   r   r9     
   
z$ConditionTests.test_wait.<locals>.c1c                    r   r;   r   r7   r   r   r   r=     r   z$ConditionTests.test_wait.<locals>.c2c                    r   r>   r   r7   r   r   r   r@     r   z$ConditionTests.test_wait.<locals>.c3r   r4   r<   rA   )r   r%   rB   r.   rC   r   r    r   r   notifyrD   rE   r8   rF   r   r   r   rz     sN   
zConditionTests.test_waitc                    s   t  }| I d H  t | }t  |j | t j	 |I d H  W d    n1 s1w   Y  | 
|j | |  d S r   )r   r%   r   rB   rv   r)   rK   rL   rM   rN   r   rO   r   r    )r   r   rv   r   r   r   r}     s   zConditionTests.test_wait_cancelc                    s   t  }| I d H  | |  t | }t dI d H  | |  | I d H  | |  |	  t 
 |j t 
 |j z|I d H  W n
 t jy\   Y nw | |  d S Nr   )r   r%   r   r   r    rB   rv   r.   r   r   r)   rK   rL   rD   rN   )r   r   Z	wait_taskr   r   r   test_wait_cancel_contested  s$   z)ConditionTests.test_wait_cancel_contestedc                    s   dt    fdd}t | }t dI d H    I d H     t dI d H  |  t dI d H     t dI d H  | |	  |  d S )NFc                	      sR    4 I d H  d   I d H  W d   I d H  d S 1 I d H s"w   Y  d S NT)rv   r   r   Zwaitedr   r   wait_on_cond  s
   .zBConditionTests.test_wait_cancel_after_notify.<locals>.wait_on_condr   )
r   r%   rB   r.   r   r   rL   rD   r   rX   )r   r   waiterr   r   r   test_wait_cancel_after_notify  s   z,ConditionTests.test_wait_cancel_after_notifyc                    sH   t  }| t | I d H  W d    d S 1 sw   Y  d S r   )r   r%   rM   rd   rv   r   r   r   r   r   test_wait_unacquired  s
   "z#ConditionTests.test_wait_unacquiredc                    s   t   dfddg } fdd}t ||}t dI d H  | g |   I d H        t dI d H  | g | d  I d H        t dI d H  | dg| | |	  | |
  d S )	NFc                      s    S r   r   r   )presultr   r   	predicate  s   z/ConditionTests.test_wait_for.<locals>.predicatec                    s6      I d H   I d H r| d    dS r3   )r   wait_forr6   rD   r7   )r   r   r   r   r9     s   
z(ConditionTests.test_wait_for.<locals>.c1r   Tr4   r   r%   rB   r.   rC   r   r   rD   r   rE   r8   r   r   )r   r   r   r   test_wait_for  s,   zConditionTests.test_wait_forc                    sr   t  }|dd I d H }| g d| | t |dd I d H  W d    d S 1 s2w   Y  d S )Nc                   S   s   g dS )NrA   r   r   r   r   r   <lambda>>  s    z9ConditionTests.test_wait_for_unacquired.<locals>.<lambda>rA   c                   S   s   dS )NFr   r   r   r   r   r   B  s    )r   r%   r   rC   rM   rd   )r   r   r{   r   r   r   test_wait_for_unacquired:  s   "z'ConditionTests.test_wait_for_unacquiredc                    sX  t   g } fdd} fdd} fdd}t ||}t ||}t ||}t dI d H  | g |   I d H   d    t dI d H  | dg|   I d H   d  d	    t dI d H  | g d
| | |	  | |
  | |	  | |
  | |	  | |
  d S )Nc                    4      I d H    I d H r| d    dS r3   r   rv   r6   rD   r7   r   r   r   r9   H     
z&ConditionTests.test_notify.<locals>.c1c                    r   r;   r   r7   r   r   r   r=   O  r   z&ConditionTests.test_notify.<locals>.c2c                    r   r>   r   r7   r   r   r   r@   V  r   z&ConditionTests.test_notify.<locals>.c3r   r4   i   rA   r   rF   r   r   r   test_notifyD  s8   


zConditionTests.test_notifyc                    s   t   g } fdd} fdd}t ||}t ||}t dI d H  | g |   I d H        t dI d H  | ddg| | |	  | |
  | |	  | |
  d S )Nc                    r   r3   r   r7   r   r   r   r9   }  r   z*ConditionTests.test_notify_all.<locals>.c1c                    r   r;   r   r7   r   r   r   r=     r   z*ConditionTests.test_notify_all.<locals>.c2r   r4   r<   )r   r%   rB   r.   rC   r   
notify_allrD   r   rE   r8   )r   r8   r9   r=   rG   rH   r   r   r   test_notify_allx  s$   zConditionTests.test_notify_allc                 C      t  }| t|j d S r   )r   r%   rM   rd   r   r   r   r   r   test_notify_unacquired     z%ConditionTests.test_notify_unacquiredc                 C   r   r   )r   r%   rM   rd   r   r   r   r   r   test_notify_all_unacquired  r   z)ConditionTests.test_notify_all_unacquiredc                    s   t  }| dt|v  | tt| | I d H  | dt|v  |jt	
  | dt|v  | tt| |jt	
  | dt|v  | tt| d S )Nunlockedr    ro   	waiters:2)r   r%   r   r   r   r   r   rO   r6   r   rr   r   r   r   r   r     s   zConditionTests.test_reprc              	      ri   r   )r   r%   r   r    r   r   r   r   r   rj     s   (z#ConditionTests.test_context_managerc                    sP   d fdd	}| I d H  |t  I d H  t  }||t |I d H  d S )Nc              	      s2  | d u r	t  } |d u rt | } |j|   |    |  |4 I d H   |    |  W d   I d H  n1 I d H sLw   Y   |    |  | 4 I d H   |    |  W d   I d H  n1 I d H sw   Y   |    |  d S r   )r   r
   r%   ZassertIs_lockr   r    r   r   r   r/   r   r   f  s(   
((z,ConditionTests.test_explicit_lock.<locals>.f)NN)r   r
   r%   )r   r   r   r   r/   r   test_explicit_lock  s   z!ConditionTests.test_explicit_lockc                    sN   t    j  fdd} fdd}| I d H  | I d H  d S )Nc               	      s    t tj d W d    n1 sw   Y  t }  | _| 4 I d H . t| }td | I d H  W d    n1 sGw   Y  W d   I d H  d S 1 I d H s]w   Y  d S Nr#   z"is bound to a different event loop)	rM   r   r   r
   _loopr%   r   rd   r   r   r$   r   r   r   wrong_loop_in_lock  s   
.z?ConditionTests.test_ambiguous_loops.<locals>.wrong_loop_in_lockc               	      s   t  } | 4 I d H M t t j|  d W d    n1 s#w   Y  t | } |_td | I d H  W d    n1 sHw   Y  W d   I d H  d S 1 I d H s^w   Y  d S r   )	r   r
   rM   r   r%   r   r   rd   rv   r   r   r   r   wrong_loop_in_cond  s   
.z?ConditionTests.test_ambiguous_loops.<locals>.wrong_loop_in_cond)r   Znew_event_loopZ
addCleanupclose)r   r   r   r   r   r   test_ambiguous_loops  s   z#ConditionTests.test_ambiguous_loopsc              	      s   t  }|4 I d H . | t j t j| ddI d H  W d    n1 s)w   Y  W d   I d H  d S 1 I d H s?w   Y  d S )Ng      ?timeout)r   r%   rM   TimeoutErrorr   rv   )r   Z	conditionr   r   r   test_timeout_in_block  s   .z$ConditionTests.test_timeout_in_blockN)r*   rk   rl   rz   r}   r   r   r   r   r   r   r   r   r   r   rj   r   r   r   r   r   r   r   r     s"    ?%
4$&r   c                   @   s|   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd ZdS )SemaphoreTestsc                 C   s   t d}| |  d S r   )r   r'   r   r    r   semr   r   r   test_initial_value_zero  s   
z&SemaphoreTests.test_initial_value_zeroc                    s   t  }| t|d | tt| | I d H  | t|d | dt|v | tt| |jd u rGt	
 |_|jt  | dt|v  | tt| |jt  | dt|v  | tt| d S )Nz[unlocked, value:1]>r	   waitersro   r   )r   r'   r   r   r   r   r   r   rO   collectionsdequer6   r   rr   r   r   r   r   r     s    

zSemaphoreTests.test_reprc                    s   t   | d j | t t j fdd}W d    n1 s%w   Y  | td | I d H  W d    n1 sAw   Y  | 	 
  | d j d S )Nr4   c                   3   r   r   r   r   r   r   r   r   "  r   z3SemaphoreTests.test_semaphore.<locals>.acquire_lockz"'Semaphore' object is not iterable)r   r'   rC   _valuer   r   r   r   r   r   r    r!   r   r   r   test_semaphore  s   zSemaphoreTests.test_semaphorec                 C   s   |  ttjd d S )N)rM   
ValueErrorr   r'   r/   r   r   r   test_semaphore_value/  s   z#SemaphoreTests.test_semaphore_valuec                    s  t d g }|   I d H  |   I d H  |     fdd} fdd} fdd} fdd	}t ||}t ||}t ||}t d
I d H  | dg| |    | dt	 j
 | d
 j t ||}	      | d
 j t d
I d H  | d
 j | dt	| |    | dt	 j
 | d
 j | |  | |  |||	g}
dd |
D }| dt	|    t j|
 I d H  d S )Nr?   c                          I d H  | d dS r3   r5   r7   r   r   r   r9   :  r:   z'SemaphoreTests.test_acquire.<locals>.c1c                    r   r;   r5   r7   r   r   r   r=   ?  r:   z'SemaphoreTests.test_acquire.<locals>.c2c                    r   r>   r5   r7   r   r   r   r@   D  r:   z'SemaphoreTests.test_acquire.<locals>.c3c                    r   )N   Tr5   r7   r   r   r   c4I  r:   z'SemaphoreTests.test_acquire.<locals>.c4r   r4   r<   c                 S   s    g | ]}|  r| r|qS r   )rE   r8   .0r   r   r   r   
<listcomp>h  s     z/SemaphoreTests.test_acquire.<locals>.<listcomp>)r   r'   r   r   r   r    rB   r.   rC   rV   rO   r   rD   rE   r8   gather)r   r8   r9   r=   r@   r   rG   rH   rI   t4Z
race_tasksZ
done_tasksr   r   r   rJ   2  sF   

zSemaphoreTests.test_acquirec                    s   t  }| I d H  t | }t  |j | t j |I d H  W d    n1 s1w   Y  | 	|j
 pEtdd |j
D  d S )Nc                 s       | ]}|  V  qd S r   rE   )r   r   r   r   r   	<genexpr>x      z5SemaphoreTests.test_acquire_cancel.<locals>.<genexpr>)r   r'   r   rB   r)   rK   rL   rM   rN   r   rO   all)r   r   r   r   r   r   rP   o  s   z"SemaphoreTests.test_acquire_cancelc                    s   t jdd}t | }t | }t | }t | }t dI d H  |  |  |  t dI d H  t dI d H  tdd ||fD }| |d | 	|
  | |
  |  |  t dI d H  d S )Nr   valuec                 s   r   r   r   r   r   r   r   r     r   zCSemaphoreTests.test_acquire_cancel_before_awoken.<locals>.<genexpr>r4   )r   r'   rB   r   r.   rL   rD   sumrC   r   rE   r   )r   r   rG   rH   rI   r   Znum_doner   r   r   !test_acquire_cancel_before_awokenz  s&   z0SemaphoreTests.test_acquire_cancel_before_awokenc                    s   t jdd}t | }t | }t dI d H  |  |  t dI d H  t dI d H  | |  | |	  d S )Nr   r   )
r   r'   rB   r   r.   rL   rD   r   r    rE   )r   r   rG   rH   r   r   r   test_acquire_hang  s   z SemaphoreTests.test_acquire_hangc                    s   t dfdd} fdd}t | }t | t j|ddI d H \}} |d u   t|t j t j dd	I d H  d S )
Nr4   c                	      sV    4 I d H  t dI d H  W d   I d H  n1 I d H s w   Y    d S r   )r   r.   rL   r   )r   rH   r   r   r9     s
   (z/SemaphoreTests.test_acquire_no_hang.<locals>.c1c                	      sJ   4 I d H    d W d   I d H  d S 1 I d H sw   Y  d S r   )r   r   r   r   r   r=     s   .z/SemaphoreTests.test_acquire_no_hang.<locals>.c2T)return_exceptionsg      ?r   )	r   r'   rB   r   r   
isinstancerN   r   r   )r   r9   r=   rG   Zr1Zr2r   )r   r   rH   r   test_acquire_no_hang  s   
z#SemaphoreTests.test_acquire_no_hangc                 C   r   r   )r   r(   rM   r   rD   r   r   r   r   re     s   z(SemaphoreTests.test_release_not_acquiredc                    rf   r   )r   r'   r   r   r    rD   r   r   r   r   r   rg     rh   z&SemaphoreTests.test_release_no_waitersc                    sp   t dg   fdd}t |d}t |d}t |d}t |||I d H  | g d  d S )Nr4   c                    sr     I d H   |  d tdI d H      I d H   |  d tdI d H    d S )NZ_1r-   Z_2)r   r6   r   r.   rD   )tagr8   r   r   r   coro  s   z4SemaphoreTests.test_acquire_fifo_order.<locals>.coror9   r=   r@   )Zc1_1Zc2_1Zc3_1Zc1_2Zc2_2Zc3_2)r   r'   rB   r   rC   )r   r   rG   rH   rI   r   r   r   test_acquire_fifo_order  s   
z&SemaphoreTests.test_acquire_fifo_orderc           	         s   t d g } fdd} fdd} fdd}t ||}t ||}t ||}t dI d H        |||g}t j| I d H  | g d	| d S )
Nr4   c                    r   r3   r5   r7   r   r   r   r9     r:   z4SemaphoreTests.test_acquire_fifo_order_2.<locals>.c1c                    s>      I d H  | d       I d H  | d dS )Nr<   r   T)r   r6   rD   r7   r   r   r   r=     s   

z4SemaphoreTests.test_acquire_fifo_order_2.<locals>.c2c                    r   r>   r5   r7   r   r   r   r@     r:   z4SemaphoreTests.test_acquire_fifo_order_2.<locals>.c3r   )r4   r<   r?   r   )r   r'   rB   r.   rD   r   rC   	r   r8   r9   r=   r@   rG   rH   rI   Ztasksr   r   r   test_acquire_fifo_order_2  s   

z(SemaphoreTests.test_acquire_fifo_order_2c           	         s   t d g } fdd} fdd} fdd}t ||}t ||}t ||}t dI d H  |  t dI d H        |||g}t j|dd	iI d H  | d
dg| d S )Nr   c                    r   r3   r5   r7   r   r   r   r9     r:   z4SemaphoreTests.test_acquire_fifo_order_3.<locals>.c1c                    r   r;   r5   r7   r   r   r   r=   
  r:   z4SemaphoreTests.test_acquire_fifo_order_3.<locals>.c2c                    r   r>   r5   r7   r   r   r   r@     r:   z4SemaphoreTests.test_acquire_fifo_order_3.<locals>.c3r   Tr<   r?   )r   r'   rB   r.   rL   rD   r   rC   r   r   r   r   test_acquire_fifo_order_3  s"   

z(SemaphoreTests.test_acquire_fifo_order_3N)r*   rk   rl   r   r   r   r   rJ   rP   r   r   r   re   rg   r   r   r   r   r   r   r   r     s    =#r   __main__)Zunittestr   rer   r   ZSTR_RGX_REPRcompiler   r   ZIsolatedAsyncioTestCaser   rm   r   r   r*   mainr   r   r   r   <module>   s.    
  l  s  &