Viewing File: /opt/hc_python/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_gc.cpython-312.pyc

�

`�*jj��f�ddlZddlZddlZddlmZddlmZejsJ�Gd�de�Zy)�N�)�TestCase)�fails_leakcheckc�.�eZdZd�Zd�Zd�Zed��Zy)�TestGCc��tjtjtj�j	��}tj�|��$ddl}td|j|���|j|��|jt
jt
j�y)NrzO IS NOT NONE.)
�weakref�ref�greenlet�
getcurrent�switch�gc�collect�sys�print�getrefcount�assertIsNone�assertFalse�garbage)�self�ors   �G/opt/hc_python/lib64/python3.12/site-packages/greenlet/tests/test_gc.py�test_dead_circular_refzTestGC.test_dead_circular_refs{���K�K��)�)�(�*=�*=�>�E�E�G�H��
�
�
���3�?���"�C�O�O�A�C�$8�9����!�#��������R�Z�Z�0�c�,�Gd�dtj�}|�}||_tj|�}t	j
�|j
|��|jtjtj�y)Nc��eZdZdZy)�8TestGC.test_circular_greenlet.<locals>.circular_greenletN)�__name__�
__module__�__qualname__r�rr�circular_greenletrs���Drr")	rrr	r
rrrrr)rr"rs   r�test_circular_greenletzTestGC.test_circular_greenletsa��	�� 1� 1�	��������K�K��N��
�
�
�����!�#��������R�Z�Z�0rc��Gd�dtj�}|�}tj|�}tj�|j|��|j
tjtj�y)Nc��eZdZd�Zd�Zy)�3TestGC.test_inactive_ref.<locals>.inactive_greenletc�Z�tjj||j��y)N)�run)r�__init__r(�rs rr)z<TestGC.test_inactive_ref.<locals>.inactive_greenlet.__init__$s���!�!�*�*�4�T�X�X�*�>rc��y�Nr!r*s rr(z7TestGC.test_inactive_ref.<locals>.inactive_greenlet.run'���rN)rrr r)r(r!rr�inactive_greenletr&#s��
?�
rr.)rr	r
rrrrr)rr.rs   r�test_inactive_refzTestGC.test_inactive_ref"s\��	�� 1� 1�	�
����K�K��N��
�
�
�����!�#��������R�Z�Z�0rc�,���Gd�dt��g}tj����fd�}tj|�}||_|j	|�|j�~~tj�t
j�y)Nc��eZdZd�Zy)�:TestGC.test_finalizer_crash.<locals>.object_with_finalizerc��yr,r!r*s r�__del__zBTestGC.test_finalizer_crash.<locals>.object_with_finalizer.__del__Cr-rN)rrr r4r!rr�object_with_finalizerr2Bs��
rr5c�����tj�_	�j�tj�`y#tj$rtd�Y�5wxYw#tj�`wxYw)NzGot greenlet exit!)rr�objectr
�GreenletExitr)r5�parents��r�
greenlet_bodyz2TestGC.test_finalizer_crash.<locals>.greenlet_bodyGsh���+@�+B�H���!�(�
1��
�
���'�'�)�0���(�(�
,��*�+�
,���'�'�)�0�s#�A�A'�$A*�&A'�'A*�*B)r7rr�array�appendr
rr)rr;r:�gr5r9s    @@r�test_finalizer_crashzTestGC.test_finalizer_crash/sq���&	�F�	����$�$�&��	1�
���m�,�����
���Q��	���
��
�����
�
�
�rN)rrr rr#r/rr>r!rrrrs%��1�1�1��&��&rr)	rr	r�r�	leakcheckr�GREENLET_USE_GCrr!rr�<module>rBs5��	����&������H�X�Hr
Back to Directory File Manager