
    +hs                     >    d dl Z d dlZd dlZddlmZ  G d de      Zy)    N   )TestCasec                       e Zd Zd Zd Zd Zy)WeakRefTestsc                     d }t        j                   |             }t        j                          | j	                   |       d        y )Nc                  R    t        j                   d       } | j                          | S )Nc                       y N r       N/var/www/html/venv/lib/python3.12/site-packages/greenlet/tests/test_weakref.py<lambda>zHWeakRefTests.test_dead_weakref.<locals>._dead_greenlet.<locals>.<lambda>       r   )greenletswitch)gs    r   _dead_greenletz6WeakRefTests.test_dead_weakref.<locals>._dead_greenlet
   s     !!,/AHHJHr   )weakrefrefgccollectassertEqual)selfr   os      r   test_dead_weakrefzWeakRefTests.test_dead_weakref	   s5    	 KK()


d#r   c                     t        j                  t        j                               }t        j                          | j                   |       d        y r
   )r   r   r   r   r   r   )r   r   s     r   test_inactive_weakrefz"WeakRefTests.test_inactive_weakref   s4    KK))+,


d#r   c                     g fd}t        j                   |      j                          t        j                   d       }t        j                  |      d }| j	                  d g       y )Nc                      	 t        j                         j                  j                          j	                                  y # j	                                  w xY wr
   )r   
getcurrentparentr   append)r   seens   r   workerz1WeakRefTests.test_dealloc_weakref.<locals>.worker   s@    !##%,,335AC AC s   ,A Ac                       y r
   r   r   r   r   r   z3WeakRefTests.test_dealloc_weakref.<locals>.<lambda>    r   r   )r   r   r   r   r   )r   r$   g2r   r#   s      @@r   test_dealloc_weakrefz!WeakRefTests.test_dealloc_weakref   s^    	!
 f%	
|Q/KKOv&r   N)__name__
__module____qualname__r   r   r'   r   r   r   r   r      s    $$
'r   r   )r   r   r    r   r   r   r   r   <module>r,      s    	   '8 'r   