Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_finalization.cpython-311.opt-1.pyc
�

�Ke�:����dZddlZddlZddlZddlZ	ddlmZn#e$rd�ZYnwxYw	ddlmZn#e$rd�ZYnwxYwddl	m
Z
Gd�d	��ZGd
�de��ZeGd�d
e����Z
eGd�de����ZGd�de��ZGd�de��ZGd�d��ZGd�deej��ZGd�d��ZGd�dee��ZGd�dee��ZGd�dee��ZGd �d!eej��ZGd"�d#��ZGd$�d%ee��ZGd&�d'ee��ZGd(�d)ee��ZGd*�d+eej��ZGd,�d-e��ZeGd.�d/e����ZeGd0�d1e����Z eGd2�d3ee����Z!e
j"Gd4�d5eej����Z#e$d6krej%��dSdS)7zB
Tests for object finalization semantics, as outlined in PEP 442.
�N)�with_tp_delc�,�Gd�dt��}|S)Nc��eZdZd�ZdS)�with_tp_del.<locals>.Cc� �td���)Nzrequires _testcapi.with_tp_del��	TypeError��cls�args�kwargss   �@/usr/local/apps/python3/lib/python3.11/test/test_finalization.py�__new__zwith_tp_del.<locals>.C.__new__s��� @�A�A�A�N��__name__�
__module__�__qualname__r�rr�Crs(������
B�
B�
B�
B�
Brr)�object�rrs  rrr
s;��	B�	B�	B�	B�	B��	B�	B�	B��r)�
without_gcc� �Gd�d��}|S)Nc��eZdZd�ZdS)�without_gc.<locals>.Cc� �td���)Nzrequires _testcapi.without_gcrr
s   rrzwithout_gc.<locals>.C.__new__s��� ?�@�@�@rNrrrrrrs(������
A�
A�
A�
A�
Arrrrs  rrrs9��	A�	A�	A�	A�	A�	A�	A�	A��r)�supportc��eZdZdZgZgZgZgZdZdZ	e
d���Ze
ej
d�����Zd�Zd�Zd�Zd	S)
�NonGCSimpleBasezd
    The base class for all the objects under test, equipped with various
    testing features.
    Frc�0�|j���|j���tj���tj��|j���|j���dS�N)�	survivors�clear�errors�gc�garbage�collect�	del_calls�tp_del_calls�rs r�_cleanupzNonGCSimpleBase._cleanup.sx���
�������
������
�
������
�
�����
���������� � � � � rc#�K�tj��5|j���|j���dt
_	dV�|jr
|jd�	dt
_|���n%#dt
_|���wxYw	ddd��dS#1swxYwYdS)zI
        A context manager to use around all finalization tests.
        FNrT)	r�
disable_gcr)r$r*r �	_cleaningr%r,r+s r�testzNonGCSimpleBase.test7s
�����
�
!�
!�
	�
	��M���!�!�!���"�"�$�$�$�(-�O�%�
������:�(��*�Q�-�'�(�-1��)���������-1��)������������
	�
	�
	�
	�
	�
	�
	�
	�
	�
	�
	�
	����
	�
	�
	�
	�
	�
	s)�?C�B�/!C�"B2�2C�C�
Cc��dS)z8
        Check the object is sane (non-broken).
        Nr��selfs r�check_sanityzNonGCSimpleBase.check_sanityI����rc��	|jsQ|j�t|����|���|���dSdS#t$r%}|j�|��Yd}~dSd}~wwxYw)z�
        PEP 442 finalizer.  Record that this was called, check the
        object is in a sane state, and invoke a side effect.
        N)r/r)�append�idr4�side_effect�	Exceptionr%�r3�es  r�__del__zNonGCSimpleBase.__del__Ns���
	"��>�
#���%�%�b��h�h�/�/�/��!�!�#�#�#�� � �"�"�"�"�"�
#�
#���	"�	"�	"��K���q�!�!�!�!�!�!�!�!�!�����	"�����AA�
B�&B�Bc��dS)z6
        A side effect called on destruction.
        Nrr2s rr9zNonGCSimpleBase.side_effect[r5rN)rrr�__doc__r#r)r*r%r/�	__slots__�classmethodr,�
contextlib�contextmanagerr0r4r=r9rrrr r s���������
�I��I��L�
�F��I��I��!�!��[�!���������[�� ���
"�"�"�����rr c��eZdZd�Zd�ZdS)�
SimpleBasec�.�t|��|_dSr")r8�id_r2s r�__init__zSimpleBase.__init__cs���d�8�8����rc��dSr"rr2s rr4zSimpleBase.check_sanityfr5rN)rrrrIr4rrrrFrFas2���������$�$�$�$�$rrFc��eZdZdZdS)�NonGCrN)rrrrArrrrLrLjs�������I�I�IrrLc��eZdZdZd�ZdS)�NonGCResurrectorrc�:�|j�|��dS�zF
        Resurrect self by storing self in a class-wide list.
        N�r#r7r2s rr9zNonGCResurrector.side_effectr� ��	
����d�#�#�#�#�#rN)rrrrAr9rrrrNrNns(�������I�$�$�$�$�$rrNc��eZdZdS)�SimpleN�rrrrrrrTrTx��������DrrTc��eZdZd�ZdS)�SimpleResurrectorc�:�|j�|��dSrPrQr2s rr9zSimpleResurrector.side_effect~rRrN�rrrr9rrrrXrX|s#������$�$�$�$�$rrXc�8�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�TestBasec�Z�tjdd�|_gtjdd�<dSr")r&r'�old_garbager2s r�setUpzTestBase.setUp�s'���:�a�a�a�=�����
�1�1�1�
�
�
rc��	|�tjg��|`tj��dS#|`tj��wxYwr")�assertEqualr&r'r^r(r2s r�tearDownzTestBase.tearDown�sM��	����R�Z��,�,�,�� ��J�L�L�L�L�L��� ��J�L�L�L�L���s	� 9�Ac�z�|�ttj��t|����dSr")ra�sortedrFr)�r3�idss  r�assert_del_callszTestBase.assert_del_calls�s/������
� 4�5�5�v�c�{�{�C�C�C�C�Crc�z�|�ttj��t|����dSr")rardrFr*res  r�assert_tp_del_callszTestBase.assert_tp_del_calls�s/������
� 7�8�8�&��+�+�F�F�F�F�Frc��|�td�tjD����t|����dS)Nc3�4K�|]}t|��V��dSr"�r8��.0�xs  r�	<genexpr>z,TestBase.assert_survivors.<locals>.<genexpr>�s(����D�D�!��1���D�D�D�D�D�Dr)rardrFr#res  r�assert_survivorszTestBase.assert_survivors�s>������D�D�z�/C�D�D�D�D�D�f�S�k�k�R�R�R�R�Rrc��|�td�tjD����t|����dS)Nc3�4K�|]}t|��V��dSr"rlrms  rrpz*TestBase.assert_garbage.<locals>.<genexpr>�s(����:�:�!��1���:�:�:�:�:�:r)rardr&r'res  r�assert_garbagezTestBase.assert_garbage�s=������:�:�r�z�:�:�:�:�:�F�3�K�K�H�H�H�H�Hrc�B�tj���dSr")rFr#r$r2s r�clear_survivorszTestBase.clear_survivors�s����"�"�$�$�$�$�$rN)
rrrr_rbrgrirqrtrvrrrr\r\�s�������������D�D�D�G�G�G�S�S�S�I�I�I�%�%�%�%�%rr\c�^�eZdZdZd�Zd�Zejd���Zejd���Z	dS)�SimpleFinalizationTestz.
    Test finalization without refcycles.
    c��t���5t��}t|��g}t	j|��}~t
j��|�|��|�	g��|�
|��d��t
j��|�|��|�	g��ddd��dS#1swxYwYdSr")rFr0rTr8�weakref�refr&r(rgrq�assertIs�r3�srf�wrs    r�test_simplez"SimpleFinalizationTest.test_simple�s��
�_�_�
�
�	&�	&����A��a�5�5�'�C���Q���B���J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%��M�M�"�"�$�$��%�%�%��J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&��CC3�3C7�:C7c�b�t���5t��}t|��g}t	j|��}~t
j��|�|��|�	|��|�
|��d��|���t
j��|�|��|�	g��ddd��n#1swxYwY|�|��d��dSr")
rFr0rXr8rzr{r&r(rgrq�assertIsNotrvr|r}s    r�test_simple_resurrectz,SimpleFinalizationTest.test_simple_resurrect�sE��
�_�_�
�
�	&�	&�!�#�#�A��a�5�5�'�C���Q���B���J�L�L�L��!�!�#�&�&�&��!�!�#�&�&�&����R�R�T�T�4�(�(�(�� � �"�"�"��J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	
�
�
�b�b�d�d�D�!�!�!�!�!s�C D�D
�
D
c���t���5t��}|�t	j|����t
|��g}~t	j��|�|��|�	g��t	j��|�|��|�	g��ddd��dS#1swxYwYdSr")
rFr0rL�assertFalser&�
is_trackedr8r(rgrq�r3r~rfs   r�test_non_gcz"SimpleFinalizationTest.test_non_gc�s��
�_�_�
�
�
	&�
	&����A����R�]�1�-�-�.�.�.��a�5�5�'�C���J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%��J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%�
	&�
	&�
	&�
	&�
	&�
	&�
	&�
	&�
	&�
	&�
	&�
	&����
	&�
	&�
	&�
	&�
	&�
	&s�CC(�(C,�/C,c��t���5t��}|�t	j|����t
|��g}~t	j��|�|��|�	|��|�
��t	j��|�|dz��|�	|��ddd��dS#1swxYwYdS�N�)rFr0rNr�r&r�r8r(rgrqrvr�s   r�test_non_gc_resurrectz,SimpleFinalizationTest.test_non_gc_resurrect�s+��
�_�_�
�
�	'�	'� �"�"�A����R�]�1�-�-�.�.�.��a�5�5�'�C���J�L�L�L��!�!�#�&�&�&��!�!�#�&�&�&�� � �"�"�"��J�L�L�L��!�!�#��'�*�*�*��!�!�#�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�	'�	's�CC?�?D�DN)
rrrr@r�r�r�cpython_onlyr�r�rrrrxrx�sz��������&�&�&�"�"�"� 
��&�&���&�
��'�'���'�'�'rrxc�(��eZdZ�fd�Z�fd�Z�xZS)�
SelfCycleBasec�V��t�����||_dSr")�superrIr{�r3�	__class__s �rrIzSelfCycleBase.__init__�s$���
������������rc�H��t�����dSr")r�r4r�s �rr4zSelfCycleBase.check_sanity�s���
���������r)rrrrIr4�
__classcell__�r�s@rr�r��sQ������������ � � � � � � � � rr�c��eZdZdS)�SimpleSelfCycleNrUrrrr�r��rVrr�c��eZdZdS)�SelfCycleResurrectorNrUrrrr�r��rVrr�c��eZdZd�ZdS)�SuicidalSelfCyclec��d|_dS)�7
        Explicitly break the reference cycle.
        N)r{r2s rr9zSuicidalSelfCycle.side_effect�s������rNrZrrrr�r��s#����������rr�c�$�eZdZdZd�Zd�Zd�ZdS)�SelfCycleFinalizationTestzX
    Test finalization of an object having a single cyclic reference to
    itself.
    c��t���5t��}t|��g}t	j|��}~t
j��|�|��|�	g��|�
|��d��t
j��|�|��|�	g��ddd��dS#1swxYwYdSr")rFr0r�r8rzr{r&r(rgrqr|r}s    rr�z%SelfCycleFinalizationTest.test_simples��
�_�_�
�
�	&�	&��!�!�A��a�5�5�'�C���Q���B���J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%��M�M�"�"�$�$��%�%�%��J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&r�c�d�t���5t��}t|��g}t	j|��}~t
j��|�|��|�	|��|�
|��d��|���t
j��|�|��|�	g��|�
|��d��ddd��dS#1swxYwYdSr")rFr0r�r8rzr{r&r(rgrqr|rvr}s    rr�z/SelfCycleFinalizationTest.test_simple_resurrectsL��
�_�_�
�
�	&�	&�$�&�&�A��a�5�5�'�C���Q���B���J�L�L�L��!�!�#�&�&�&��!�!�#�&�&�&��M�M�"�"�$�$��%�%�%�
� � �"�"�"��J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%��M�M�"�"�$�$��%�%�%�!	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&s�C>D%�%D)�,D)c�<�t���5t��}t|��g}t	j|��}~t
j��|�|��|�	g��|�
|��d��t
j��|�|��|�	g��|�
|��d��ddd��dS#1swxYwYdSr")rFr0r�r8rzr{r&r(rgrqr|r}s    r�test_simple_suicidez-SelfCycleFinalizationTest.test_simple_suicide%s:���_�_�
�
�	&�	&�!�#�#�A��a�5�5�'�C���Q���B���J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%��M�M�"�"�$�$��%�%�%��J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%��M�M�"�"�$�$��%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&s�C*D�D�DN)rrrr@r�r�r�rrrr�r��sK��������
&�&�&�&�&�&�(&�&�&�&�&rr�c�$��eZdZd�Z�fd�Z�xZS)�ChainedBasec�0�d|_||_||_dS)NF��suicided�left�right)r3r�s  r�chainzChainedBase.chain9s����
���	���
�
�
rc���t�����|jrdS|j}|jr	|j}|jrdSdSr")r�r4r�r�r�)r3r�r�r�s   �rr4zChainedBase.check_sanity>sl���
���������=�
	*�
	*�
	*��9�D��}�
*�
*��J�E��~�
*�
*�
*�
*�
*r)rrrr�r4r�r�s@rr�r�7sG����������
*�*�*�*�*�*�*�*�*rr�c��eZdZdS)�
SimpleChainedNrUrrrr�r�OrVrr�c��eZdZdS)�ChainedResurrectorNrUrrrr�r�RrVrr�c��eZdZd�ZdS)�SuicidalChainedc�0�d|_d|_d|_dS)r�TNr�r2s rr9zSuicidalChained.side_effectWs����
���	���
�
�
rNrZrrrr�r�Us#����������rr�c�T�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
S)�CycleChainFinalizationTestz�
    Test finalization of a cyclic chain.  These tests are similar in
    spirit to the self-cycle tests above, but the collectable object
    graph isn't trivial anymore.
    c��d�|D��}tt|����D]&}||�||dz
���'|S)Nc�"�g|]}|����
Srr)rnrs  r�
<listcomp>z:CycleChainFinalizationTest.build_chain.<locals>.<listcomp>hs��*�*�*�3�����*�*�*r�)�range�lenr�)r3�classes�nodes�is    r�build_chainz&CycleChainFinalizationTest.build_chaingsX��*�*�'�*�*�*���s�5�z�z�"�"�	'�	'�A��!�H�N�N�5��1��:�&�&�&�&��rc��t|��}t���5|�|��}d�|D��}d�|D��}~t	j��|�|��|�g��|�d�|D��dg|z��t	j��|�|��ddd��dS#1swxYwYdS)Nc�,�g|]}t|����Srrl�rnr~s  rr�zKCycleChainFinalizationTest.check_non_resurrecting_chain.<locals>.<listcomp>q���(�(�(�Q�2�a�5�5�(�(�(rc�6�g|]}tj|����Sr�rzr{r�s  rr�zKCycleChainFinalizationTest.check_non_resurrecting_chain.<locals>.<listcomp>r� ��1�1�1�a�7�;�q�>�>�1�1�1rc�"�g|]}|����
Srr�rnrs  rr�zKCycleChainFinalizationTest.check_non_resurrecting_chain.<locals>.<listcomp>w���1�1�1�r�b�b�d�d�1�1�1r)	r�rFr0r�r&r(rgrqra)r3r��Nr�rf�wrss      r�check_non_resurrecting_chainz7CycleChainFinalizationTest.check_non_resurrecting_chainms:����L�L��
�_�_�
�
�
	'�
	'��$�$�W�-�-�E�(�(�%�(�(�(�C�1�1�5�1�1�1�C���J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%����1�1�S�1�1�1�D�6�A�:�>�>�>��J�L�L�L��!�!�#�&�&�&�
	'�
	'�
	'�
	'�
	'�
	'�
	'�
	'�
	'�
	'�
	'�
	'����
	'�
	'�
	'�
	'�
	'�
	's�B8C.�.C2�5C2c�~�t|��}t���5|�|��}t|��}d�|D��}d�|D��}d�|D��}~t	j��|�|��|�|��|�d�|D��dg|z��|�	��t	j��|�|��|�g��ddd��dS#1swxYwYdS)Nc�,�g|]}t|����Srrlr�s  rr�zGCycleChainFinalizationTest.check_resurrecting_chain.<locals>.<listcomp>�r�rc�V�g|]&}t|t���t|����'Sr)�
isinstancerXr8r�s  rr�zGCycleChainFinalizationTest.check_resurrecting_chain.<locals>.<listcomp>�s.��U�U�U�a�J�q�BS�4T�4T�U�B�q�E�E�U�U�Urc�6�g|]}tj|����Srr�r�s  rr�zGCycleChainFinalizationTest.check_resurrecting_chain.<locals>.<listcomp>�r�rc�"�g|]}|����
Srrr�s  rr�zGCycleChainFinalizationTest.check_resurrecting_chain.<locals>.<listcomp>�r�r)
r�rFr0r�r&r(rgrqrarv)r3r�r�r�rf�survivor_idsr�s       r�check_resurrecting_chainz3CycleChainFinalizationTest.check_resurrecting_chain{s~����L�L��
�_�_�
�
�	&�	&��$�$�W�-�-�E��E�
�
�A�(�(�%�(�(�(�C�U�U�5�U�U�U�L�1�1�5�1�1�1�C���J�L�L�L��!�!�#�&�&�&��!�!�,�/�/�/����1�1�S�1�1�1�D�6�A�:�>�>�>�� � �"�"�"��J�L�L�L��!�!�#�&�&�&��!�!�"�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&s�C<D2�2D6�9D6c�B�|�tgdz��dS�N�)r�r�r2s r�test_homogenousz*CycleChainFinalizationTest.test_homogenous�s#���)�)�=�/�A�*=�>�>�>�>�>rc�B�|�tgdz��dSr�)r�r�r2s r�test_homogenous_resurrectz4CycleChainFinalizationTest.test_homogenous_resurrect�s%���%�%�'9�&:�Q�&>�?�?�?�?�?rc�B�|�tgdz��dSr�)r�r�r2s r�test_homogenous_suicidalz3CycleChainFinalizationTest.test_homogenous_suicidal�s$���)�)�?�*;�a�*?�@�@�@�@�@rc�N�|�ttgdz��dSr��r�r�r�r2s r�test_heterogenous_suicidal_onez9CycleChainFinalizationTest.test_heterogenous_suicidal_one�s&���)�)�?�M�*J�Q�*N�O�O�O�O�Orc�Z�|�tgdztgdzz��dSr�r�r2s r�test_heterogenous_suicidal_twoz9CycleChainFinalizationTest.test_heterogenous_suicidal_two�s;���)�)�
���!�]�O�a�$7�7�	9�	9�	9�	9�	9rc�N�|�ttgdz��dSr�)r�r�r�r2s r�test_heterogenous_resurrect_onez:CycleChainFinalizationTest.test_heterogenous_resurrect_one�s'���%�%�'9�=�&I�A�&M�N�N�N�N�Nrc�Z�|�tttgdz��dSr��r�r�r�r�r2s r�test_heterogenous_resurrect_twoz:CycleChainFinalizationTest.test_heterogenous_resurrect_two�s8���%�%�
���@�1�D�	F�	F�	F�	F�	Frc�r�|�tgdztgdzztgdzz��dSr�r�r2s r�!test_heterogenous_resurrect_threez<CycleChainFinalizationTest.test_heterogenous_resurrect_three�sN���%�%�
� �1�$�
���':�:�o�=N�QR�=R�R�	T�	T�	T�	T�	TrN)rrrr@r�r�r�r�r�r�r�r�r�r�r�rrrr�r�`s������������'�'�'�&�&�&�&?�?�?�@�@�@�A�A�A�P�P�P�9�9�9�O�O�O�F�F�F�T�T�T�T�Trr�c��eZdZd�Zd�ZdS)�
LegacyBasec���	|js=|j�t|����|���dSdS#t
$r%}|j�|��Yd}~dSd}~wwxYwr")r/r)r7r8r4r:r%r;s  rr=zLegacyBase.__del__�s���	"��>�
$���%�%�b��h�h�/�/�/��!�!�#�#�#�#�#�
$�
$���	"�	"�	"��K���q�!�!�!�!�!�!�!�!�!�����	"���s�AA�
A7�A2�2A7c��	|jsQ|j�t|����|���|���dSdS#t$r%}|j�|��Yd}~dSd}~wwxYw)zJ
        Legacy (pre-PEP 442) finalizer, mapped to a tp_del slot.
        N)r/r*r7r8r4r9r:r%r;s  r�
__tp_del__zLegacyBase.__tp_del__�s���	"��>�
#��!�(�(��D���2�2�2��!�!�#�#�#�� � �"�"�"�"�"�
#�
#���	"�	"�	"��K���q�!�!�!�!�!�!�!�!�!�����	"���r>N)rrrr=r�rrrr�r��s2������"�"�"�
"�
"�
"�
"�
"rr�c��eZdZdS)�LegacyNrUrrrr�r����������Drr�c��eZdZd�ZdS)�LegacyResurrectorc�:�|j�|��dSrPrQr2s rr9zLegacyResurrector.side_effect�rRrNrZrrrr�r��s#������$�$�$�$�$rr�c��eZdZdS)�LegacySelfCycleNrUrrrr�r��r�rr�c�4��eZdZdZ�fd�Zd�Zd�Zd�Z�xZS)�LegacyFinalizationTestz5
    Test finalization of objects with a tp_del.
    c���tj���tj��t	�����dSr")r&r'r$r(r�rbr�s �rrbzLegacyFinalizationTest.tearDown�s@���	�
������
�
����
���������rc�*�t���5t��}t|��g}t	j|��}~t
j��|�|��|�	|��|�
g��|�|��d��t
j��|�|��|�	|��ddd��dS#1swxYwYdSr")rFr0r�r8rzr{r&r(rgrirqr|r}s    r�test_legacyz"LegacyFinalizationTest.test_legacy�s0��
�_�_�
�
�	*�	*����A��a�5�5�'�C���Q���B���J�L�L�L��!�!�#�&�&�&��$�$�S�)�)�)��!�!�"�%�%�%��M�M�"�"�$�$��%�%�%��J�L�L�L��!�!�#�&�&�&��$�$�S�)�)�)�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*s�C!D�D�Dc��t���5t��}t|��g}t	j|��}~t
j��|�|��|�	|��|�
|��|�|��d��|���t
j��|�|��|�	|dz��|�
|��ddd��n#1swxYwY|�|��d��dSr�)
rFr0r�r8rzr{r&r(rgrirqr|rvr}s    r�test_legacy_resurrectz,LegacyFinalizationTest.test_legacy_resurrect�so��
�_�_�
�
�	'�	'�!�#�#�A��a�5�5�'�C���Q���B���J�L�L�L��!�!�#�&�&�&��$�$�S�)�)�)��!�!�#�&�&�&��M�M�"�"�$�$��%�%�%�� � �"�"�"��J�L�L�L��!�!�#�&�&�&��$�$�S�1�W�-�-�-��!�!�#�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'� 	
�
�
�b�b�d�d�D�!�!�!�!�!s�D
D3�3D7�:D7c�l�t���5t��}t|��g}t	j|��}~t
j��|�g��|�	g��|�
g��|�|��|�|��d��dtj
d_ddd��n#1swxYwY|�g��|�|��d��dS)Nr)rFr0r�r8rzr{r&r(rgrirqrtr�r'r|r}s    r�test_legacy_self_cyclez-LegacyFinalizationTest.test_legacy_self_cyclesJ��
�_�_�
�
�	%�	%��!�!�A��a�5�5�'�C���Q���B���J�L�L�L��!�!�"�%�%�%��$�$�R�(�(�(��!�!�"�%�%�%�����$�$�$����R�R�T�T�4�(�(�(� $�B�J�q�M��	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	
���B�����
�
�b�b�d�d�D�!�!�!�!�!s�CC6�6C:�=C:)	rrrr@rbr�r�rr�r�s@rr�r��so��������������
*�
*�
*�"�"�"�&"�"�"�"�"�"�"rr��__main__)&r@rCr&�unittestrz�	_testcapir�ImportErrorrr0rr rFrLrNrTrXr\�TestCaserxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�mainrrr�<module>rsQ��������	�	�	�	����������%�%�%�%�%�%�%����������������$�$�$�$�$�$�$���������������������?�?�?�?�?�?�?�?�D$�$�$�$�$��$�$�$�������O�������$�$�$�$�$��$�$���$�	�	�	�	�	�Z�	�	�	�$�$�$�$�$�
�$�$�$�%�%�%�%�%�%�%�%�<>'�>'�>'�>'�>'�X�x�'8�>'�>'�>'�B � � � � � � � �	�	�	�	�	�m�V�	�	�	�	�	�	�	�	�=�*;�	�	�	������
�v����7&�7&�7&�7&�7&��(�*;�7&�7&�7&�t*�*�*�*�*�*�*�*�0	�	�	�	�	�K��	�	�	�	�	�	�	�	��&7�	�	�	������k�6����GT�GT�GT�GT�GT��8�+<�GT�GT�GT�Z"�"�"�"�"��"�"�"�0
�	�	�	�	�	�Z�	�	�
��	�
�$�$�$�$�$�
�$�$�
��$�
�	�	�	�	�	�m�Z�	�	�
��	�	��>"�>"�>"�>"�>"�X�x�'8�>"�>"���>"�B�z����H�M�O�O�O�O�O��s��&�&�1�<�<