Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.22.66.147
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_super.cpython-310.pyc
o

abd&�@s�dZddlZGdd�d�ZGdd�de�ZGdd�de�ZGd	d
�d
ee�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�dej	�Z
edkrQe��dSdS)z9Unit tests for zero-argument super() & related machinery.�Nc@s eZdZdd�Zedd��ZdS)�AcCsdS�Nr���selfrr�8/usr/local/python-3.10/lib/python3.10/test/test_super.py�f�zA.fcCs|dfSrr��clsrrr�cm	�zA.cmN)�__name__�
__module__�__qualname__r�classmethodrrrrrrsrc�,eZdZ�fdd�Ze�fdd��Z�ZS)�Bc�t���dS�Nr��superrr��	__class__rrr�zB.fc�|t���dfSr�rrr
rrrr�zB.cm�rrrrrr�
__classcell__rrrrr
�rcr)�Ccr�Nr!rrrrrrrzC.fcrr"rr
rrrrrzC.cmrrrrrr!r r!cs(eZdZ�fdd�Z�fdd�Z�ZS)�Dcr�Nr#rrrrrrrzD.fcrr$rr
rrrrszD.cm)rrrrrrrrrrr#sr#c@�eZdZdS)�EN�rrrrrrrr&!�r&c@seZdZejZdS)�FN)rrrr&rrrrrr)$s
r)c@r%)�GNr'rrrrr*'r(r*cs�eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�fdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z�fd'd(�Zd)d*�Z�fd+d,�Z�ZS)-�	TestSupercst�dS�N)r+rrrr�tearDown-szTestSuper.tearDowncCs|�t���d�dS�NZABCD��assertEqualr#rrrrr�test_basics_working2szTestSuper.test_basics_workingcCs|�t�t��d�dSr.r/rrrr�test_class_getattr_working5sz$TestSuper.test_class_getattr_workingcC�*|�t���d�|�t�t��d�dSr.)r0r&rrrrr�!test_subclass_no_override_working8�z+TestSuper.test_subclass_no_override_workingcCr3r.)r0r)rrrrr�$test_unbound_method_transfer_working<r5z.TestSuper.test_unbound_method_transfer_workingcCsX|�t��tdf�|�t���tdf�|�t��tdf�|�t���tdf�dSr)r0rrr*rrrr� test_class_methods_still_working@sz*TestSuper.test_class_methods_still_workingcCs\t�}|�|��|tttdfdfdfdf�t�}|�|��|tttdfdfdfdf�dS)Nrrr!r#)r#r0rr&)r�d�errr�#test_super_in_class_methods_workingFs&*z-TestSuper.test_super_in_class_methods_workingcCs&Gdd�dt�}|�|���d�dS)Nc�eZdZ�fdd�Z�ZS)z,TestSuper.test_super_with_closure.<locals>.Ecs�fdd�}t���dS)Nc��dSr,rrrrr�nestedQ�z>TestSuper.test_super_with_closure.<locals>.E.f.<locals>.nestedr&r)rr=rrrrPsz.TestSuper.test_super_with_closure.<locals>.E.f�rrrrrrrrrr&O�r&ZAE)rr0r)rr&rrr�test_super_with_closureLsz!TestSuper.test_super_with_closurecs�Gdd�dt�}|�}|�|��d�|�|jd�G�fdd�d�}|�|jt|��|�t��}t	dt
�i�Wd�n1sCwY|�t|j�t�Gdd�d�}|�t
�dd	�t
�d=|�d|j
�G�fd
d�d�}|��d	�dS)Ncs eZdZ�fdd�ZdZ�ZS)�7TestSuper.test_various___class___pathologies.<locals>.Xcs
t���Sr,rrrrrrZ�
�9TestSuper.test_various___class___pathologies.<locals>.X.f�)rrrrrrrrrr�XYsrFrrEcs eZdZ�Z�fdd�Z�ZS)rBcr<r,rrrrrrbr>rD)rrr�xrrrrrrrF`szYclass X:
                __class__
                def f():
                    __class__cs eZdZda�fdd�Z�ZS)rB�*cr<r,rrrrrrnr>rD)rrrrrrrrrrrFk�rrHcs eZdZd��fdd�Z�ZS)rBrHcr<r,rrrrrrvr>rDr?rrrrrFsrI)rr0rr�assertIsrG�type�assertRaises�	NameError�exec�globals�	exception�assertNotIn�__dict__)rrFrGr9rrr�"test_various___class___pathologiesWs$��z,TestSuper.test_various___class___pathologiescCs$Gdd�d�}|�|���|�dS)Ncr;)z2TestSuper.test___class___instancemethod.<locals>.Xc��Sr,rrrrrr}r	z4TestSuper.test___class___instancemethod.<locals>.X.fr?rrrrrF|r@rF�rJr�rrFrrr�test___class___instancemethodzsz'TestSuper.test___class___instancemethodcC�"Gdd�d�}|�|��|�dS)Nc� eZdZe�fdd��Z�ZS)z/TestSuper.test___class___classmethod.<locals>.XcrTr,rr
rrrr��z1TestSuper.test___class___classmethod.<locals>.X.f)rrrrrrrrrrrF��rFrUrVrrr�test___class___classmethod��z$TestSuper.test___class___classmethodcCrX)NcrY)z0TestSuper.test___class___staticmethod.<locals>.XcrTr,rrrrrr�rZz2TestSuper.test___class___staticmethod.<locals>.X.f�rrr�staticmethodrrrrrrrF�r[rFrUrVrrr�test___class___staticmethod�r]z%TestSuper.test___class___staticmethodcs:d�G�fdd�dt�}Gdd�d|d�}|��|�dS)Nc�eZdZ��fdd�Z�ZS)z*TestSuper.test___class___new.<locals>.Metacst��||||�}|���|Sr,)r�__new__r)r�name�bases�	namespacer�r�
test_classrrrb�sz2TestSuper.test___class___new.<locals>.Meta.__new__�rrrrbrr�rgrr�Meta��rjcrY)z'TestSuper.test___class___new.<locals>.AcrTr,rrrrrr�rZz)TestSuper.test___class___new.<locals>.A.fr^rrrrr�r[r��	metaclass�rKrJ�rrjrrrir�test___class___new�szTestSuper.test___class___newcsVd�G�fdd�dt�}Gdd�d|d�}|�|d�tdd��}|�|��|�dS)NcseZdZ�fdd�ZdS)z.TestSuper.test___class___delayed.<locals>.Metacs|�dSr,r�rrcrdre�Ztest_namespacerrrb�sz6TestSuper.test___class___delayed.<locals>.Meta.__new__N)rrrrbrrrrrrj�srjcrY)z+TestSuper.test___class___delayed.<locals>.AcrTr,rrrrrr�rZz-TestSuper.test___class___delayed.<locals>.A.fr^rrrrr�r[rrlrr)rKrJr)rrjrrrrrr�test___class___delayed�sz TestSuper.test___class___delayedcs:d�Gdd�dt�}G�fdd�d|d�}|��|�dS)Ncr;)z*TestSuper.test___class___mro.<locals>.Metacs|jd�t���S)Nr)rRr�mrorrrrrt�s
z.TestSuper.test___class___mro.<locals>.Meta.mro)rrrrtrrrrrrj�r@rjcra)z'TestSuper.test___class___mro.<locals>.Acs��dSr,rrrfrrr�r
z)TestSuper.test___class___mro.<locals>.A.fr?rrirrr�rkrrlrnrorrir�test___class___mro�szTestSuper.test___class___mrocs�G�fdd�dt�}d�Gdd�d|d�}|�d��d�Gdd�d|d�}�d}|jj}|�t|�d	�|�||d
�|�t��|j	Wd�dS1sRwYdS)Ncra)z=TestSuper.test___classcell___expected_behaviour.<locals>.Metacs|���t��||||�Sr,)�copyrrbrq)r�namespace_snapshotrrrb�szETestSuper.test___classcell___expected_behaviour.<locals>.Meta.__new__rhr�rwrrrj�rkrjc@r%)zHTestSuper.test___classcell___expected_behaviour.<locals>.WithoutClassRefNr'rrrr�WithoutClassRef�r(ryrlrcr;)zETestSuper.test___classcell___expected_behaviour.<locals>.WithClassRefcrTr,rrrrrr�r	zGTestSuper.test___classcell___expected_behaviour.<locals>.WithClassRef.fr?rrrr�WithClassRef�r@rz�r)
rKrQr�__closure__r0�lenrJrL�AttributeErrorr)rrjryrzZ
class_cellZmethod_closurerrxr�%test___classcell___expected_behaviour�s"�z/TestSuper.test___classcell___expected_behaviourcCsjGdd�dt�}Gdd�d|d�}d}|�t|��Gdd�d|d�}Wd�dS1s.wYdS)	Ncr;)z2TestSuper.test___classcell___missing.<locals>.Metacs|�dd�t��||||�S�Nr)�poprrbrqrrrrb�sz:TestSuper.test___classcell___missing.<locals>.Meta.__new__rhrrrrrj�r@rjc@r%)z=TestSuper.test___classcell___missing.<locals>.WithoutClassRefNr'rrrrry�r(ryrlz+__class__ not set.*__classcell__ propagatedcr;)z:TestSuper.test___classcell___missing.<locals>.WithClassRefcrTr,rrrrrr�r	z<TestSuper.test___classcell___missing.<locals>.WithClassRef.fr?rrrrrz�r@rz)rKZassertRaisesRegex�RuntimeError)rrjryZexpected_errorrzrrr�test___classcell___missing�s"�z$TestSuper.test___classcell___missingc
Cs�Gdd�dt�}dddt�fD]7}|j|d��'|�t��Gdd�d||d�}Wd�n1s2wYWd�n1sAwYqdS)	Ncr;)z4TestSuper.test___classcell___overwrite.<locals>.Metacs||d<t��||||�Sr�)rrb)rrcrdre�cellrrrrbsz<TestSuper.test___classcell___overwrite.<locals>.Meta.__new__rhrrrrrjr@rjr�)�bad_cellc@r%)z1TestSuper.test___classcell___overwrite.<locals>.ANr'rrrrr
r(r)rmr�)rK�objectZsubTestrL�	TypeError)rrjr�rrrr�test___classcell___overwrite�s�����z&TestSuper.test___classcell___overwritecCsRGdd�dt�}|�t��Gdd�d|d�}Wd�dS1s"wYdS)Ncr;)z5TestSuper.test___classcell___wrong_cell.<locals>.Metacs"t��||||�}tdd|�}|S)Nrr)rrbrK)rrcrdrerrrrrbsz=TestSuper.test___classcell___wrong_cell.<locals>.Meta.__new__rhrrrrrjr@rjcr;)z2TestSuper.test___classcell___wrong_cell.<locals>.AcrTr,rrrrrrr	z4TestSuper.test___classcell___wrong_cell.<locals>.A.fr?rrrrrr@rrl)rKrLr�rorrr�test___classcell___wrong_cell
s"�z'TestSuper.test___classcell___wrong_cellcsT�fdd�}|�t|��fdd�}|�t|d�Gdd�d�}|�t|�j�dS)Nc�
t�dSr,�rrrrrrrCz.TestSuper.test_obscure_super_errors.<locals>.fcs~t�dSr,r��rGrrrrs
cr;)z.TestSuper.test_obscure_super_errors.<locals>.Xcs�t�dSr,r�r�rrrr$s
z0TestSuper.test_obscure_super_errors.<locals>.X.fr?rrrrrF#r@rF)rLr�r)rrrFrrr�test_obscure_super_errorssz#TestSuper.test_obscure_super_errorscs:Gdd�d���fdd�}|�jd}|�t�j|�dS)Ncr;)z&TestSuper.test_cell_as_self.<locals>.Xcr�r,r�rrrr�meth,rCz+TestSuper.test_cell_as_self.<locals>.X.meth)rrrr�rrrrrrF+r@rFcs����fdd�}|S)NcrTr,rr��krr�g1r	z1TestSuper.test_cell_as_self.<locals>.f.<locals>.gr)r��rFr�rr/sz&TestSuper.test_cell_as_self.<locals>.fr)r|rLr�r�)rr�crr�r�test_cell_as_self*szTestSuper.test_cell_as_selfcs*ttd�}td�D]	}t�|t|�q	dS)Ng�?i�)r�float�range�__init__�int)r�sp�irrr�test_super_init_leaks7s
�zTestSuper.test_super_init_leaks)rrrr-r1r2r4r6r7r:rArSrWr\r`rprsrurr�r�r�r�r�r�rrrrrr++s.#
r+�__main__)
�__doc__Zunittestrrr!r#r&r)r*ZTestCaser+r�mainrrrr�<module>s�
© 2025 GrazzMean