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: 18.216.142.94
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_abc.cpython-310.pyc
o

`b�\�@spdZddlZddlZddlZddlmZdd�Zeejej�\Z	Z
Zeejej�\ZZ
Zedkr6e��dSdS)zUnit tests for abc.py.�N)�
isabstractcsNG�fdd�dtj�}G��fdd�dtj�}G�fdd�dtj�}|||fS)Ncs0eZdZ�fdd�Z�fdd�Z�fdd�ZdS)z#test_factory.<locals>.TestLegacyAPIcs�tjdd��}|�|j�dd�}|�t|d��Gdd�d�d�}|�t|�Gd	d
�d
|�}|�|�j	d�|�t
|j	dd��dS)
NcS�dS�N���selfrr�6/usr/local/python-3.10/lib/python3.10/test/test_abc.py�foo�zMtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.foocSrrrrrrr�bar�zMtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.bar�__isabstractmethod__c@�eZdZejdd��ZdS)zKtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.CcS�dS�N�rrrrrr	r
zOtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.C.fooN)�__name__�
__module__�__qualname__�abc�abstractpropertyr	rrrr�C�r��	metaclassc� eZdZe�fdd��Z�ZS)zKtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.Dc�t�jSr��superr	r��	__class__rrr	�zOtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.D.foo)rrr�propertyr	�
__classcell__rrrr�D�r$rF)rr�
assertTruer
�assertFalse�hasattr�assertRaises�	TypeError�assertEqualr	�getattr�rr	rrr$��abc_ABCMetarr�test_abstractproperty_basicss
z@test_factory.<locals>.TestLegacyAPI.test_abstractproperty_basicscs�tjdd��}|�|j�tdd��}|�t|dd��Gdd�d�d	�}|�t|�Gd
d�d|�}|�	|�
�d�|�	|��
�d�dS)NcSrrr��clsrrrr	$r
zPtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.foocSrrrr1rrrr'r
zPtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.barr
Fc@r)zNtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.CcS�|jSr�rr1rrrr	,�zRtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.C.fooN)rrrr�abstractclassmethodr	rrrrr+rrrcr)zNtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.Dc�
t���Srrr1rrrr	0�
zRtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.D.foo�rrr�classmethodr	r#rrrrr$/r%r$)rr6r&r
r:r'r,r)r*r+r	r-r.rr�test_abstractclassmethod_basics#�

zCtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basicscs�tjdd��}|�|j�tdd��}|�t|dd��Gdd�d�d	�}|�t|�Gd
d�d|�}|�	|�
�d�|�	|��
�d�dS)
NcSrrrrrrrr	6r
zQtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.foocSrrrrrrrr9r
zQtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.barr
Fc@r)zOtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.CcSrrrrrrrr	>r
zStest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.C.fooN)rrrr�abstractstaticmethodr	rrrrr=rrrc@�eZdZedd��ZdS)zOtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.DcSr�N�rrrrrr	Br
zStest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.D.fooN�rrr�staticmethodr	rrrrr$A�r$r@)rr=r&r
rBr'r,r)r*r+r	r-r.rr� test_abstractstaticmethod_basics5r<zDtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basicsN)rrrr0r;rDrr.rr�
TestLegacyAPIsrEcsneZdZdd�Zdd�Z�fdd�Z�fdd�Z�fd	d
�Z�fdd�Z�fd
d�Z	�fdd�Z
�fdd�Z�fdd�Z�fdd�Z
�fdd�Z�fdd�Z��fdd�Z�fdd�Z�fdd �Z�fd!d"�Z�fd#d$�Z�fd%d&�Zd'd(�Z�fd)d*�Zd+d,�Z�fd-d.�Z�fd/d0�Z�fd1d2�Z�fd3d4�Z�fd5d6�Zd7d8�Z�fd9d:�Z�fd;d<�Z �fd=d>�Z!d?S)@ztest_factory.<locals>.TestABCcSsTGdd�dtj�}|�t|�tj�|�t|�Gdd�d|�}|�|��d�dS)Nc@�eZdZeejdd���ZdS)z8test_factory.<locals>.TestABC.test_ABC_helper.<locals>.CcSr3rr4r1rrrr	M�z<test_factory.<locals>.TestABC.test_ABC_helper.<locals>.C.fooN�rrrr:r�abstractmethodr	rrrrrL�rcr)z8test_factory.<locals>.TestABC.test_ABC_helper.<locals>.Dcr7rrr1rrrr	Sr8z<test_factory.<locals>.TestABC.test_ABC_helper.<locals>.D.foor9rrrrr$Rr%r$)r�ABCr+�type�ABCMetar)r*r	)rrr$rrr�test_ABC_helperJs
z-test_factory.<locals>.TestABC.test_ABC_helpercSs6tjdd��}|�|j�dd�}|�t|d��dS)NcSrrrrrrrr	Xr
zEtest_factory.<locals>.TestABC.test_abstractmethod_basics.<locals>.foocSrrrrrrrr[rzEtest_factory.<locals>.TestABC.test_abstractmethod_basics.<locals>.barr
)rrIr&r
r'r()rr	rrrr�test_abstractmethod_basicsWs

z8test_factory.<locals>.TestABC.test_abstractmethod_basicscs~ttjdd���}|�|j�dd�}|�t|dd��Gdd�d�d	��|�t��G�fd
d�d��}|�	|�j
d�dS)
NcSrrrrrrrr	_�zGtest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.foocSrrrrrrrrcrzGtest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.barr
Fc@rF)zEtest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.CcSrrrrrrrr	grPzItest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.C.fooN)rrrr"rrIr	rrrrrfrJrrc�$eZdZ�jj�fdd��Z�ZS)zEtest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.Dcrrrrrrrr	lr!zItest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.D.foo�rrrr	�getterr#r�rrrr$k�r$r)r"rrIr&r
r'r,r)r*r+r	)rr	rr$r.rTrr0^sz:test_factory.<locals>.TestABC.test_abstractproperty_basicscs�ttjdd���}|�|j�tdd��}|�t|dd��Gdd�d�d	�}|�t|�Gd
d�d|�}|�	|�
�d�|�	|��
�d�dS)NcSrrrr1rrrr	qrPzJtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.foocSrrrr1rrrrur
zJtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.barr
Fc@rF)zHtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.CcSr3rr4r1rrrr	zrGzLtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.C.fooNrHrrrrryrJrrcr)zHtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.Dcr7rrr1rrrr	r8zLtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.D.foor9rrrrr$~r%r$)r:rrIr&r
r'r,r)r*r+r	r-r.rrr;p�
z=test_factory.<locals>.TestABC.test_abstractclassmethod_basicscs�ttjdd���}|�|j�tdd��}|�t|dd��Gdd�d�d	�}|�t|�Gd
d�d|�}|�	|�
�d�|�	|��
�d�dS)
NcSrrrrrrrr	�rPzKtest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.foocSrrrrrrrr�r
zKtest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.barr
Fc@rF)zItest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.CcSrrrrrrrr	�rPzMtest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.C.fooN)rrrrBrrIr	rrrrr�rJrrc@r>)zItest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.DcSrr?rrrrrr	�r
zMtest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.D.fooNrArrrrr$�rCr$r@)rBrrIr&r
r'r,r)r*r+r	r-r.rrrD�rVz>test_factory.<locals>.TestABC.test_abstractstaticmethod_basicsc�(Gdd�d�d�}d}|�t||�dS)Nc@r)zPtest_factory.<locals>.TestABC.test_object_new_with_one_abstractmethod.<locals>.CcSrrrrrrr�
method_one�rPz[test_factory.<locals>.TestABC.test_object_new_with_one_abstractmethod.<locals>.C.method_oneN)rrrrrIrXrrrrr�rrrz'class C with abstract method method_one��assertRaisesRegexr*�rr�msgr.rr�'test_object_new_with_one_abstractmethod�szEtest_factory.<locals>.TestABC.test_object_new_with_one_abstractmethodcrW)Nc@s(eZdZejdd��Zejdd��ZdS)zRtest_factory.<locals>.TestABC.test_object_new_with_many_abstractmethods.<locals>.CcSrrrrrrrrX�rPz]test_factory.<locals>.TestABC.test_object_new_with_many_abstractmethods.<locals>.C.method_onecSrrrrrrr�
method_two�rPz]test_factory.<locals>.TestABC.test_object_new_with_many_abstractmethods.<locals>.C.method_twoN)rrrrrIrXr^rrrrr�s

rrz4class C with abstract methods method_one, method_tworYr[r.rr�)test_object_new_with_many_abstractmethods�szGtest_factory.<locals>.TestABC.test_object_new_with_many_abstractmethodscs
tjtjtjtjfD]x�G�fdd�d�d�}|�|jdh�|�t|�|�	t
|��Gdd�d|�}|�|jdh�|�t|�|�	t
|��Gdd�d|�}|�|jt��|�|�t
|��G�fd	d
�d
|�}|�|jdh�|�t|�|�	t
|��q
dS)Ncs eZdZ�dd��Zdd�ZdS)zHtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.CcSrrrrrrrr	�r
zLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.C.foocSrrrrrrrr�rzLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.C.barN)rrrr	rr�Z
abstractthingrrr�s
rrr	c@�eZdZdd�ZdS)zHtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.DcSrrrrrrrr�rzLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.D.barN�rrrrrrrrr$��r$c@ra)zHtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.EcSrrrrrrrr	�rzLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.E.fooN�rrrr	rrrr�E�rcrecseZdZ�dd��ZdS)zHtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.FcSrrrrrrrr�r
zLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.F.barNrbrr`rr�F�rCrfr)
rrIrr6r=r+�__abstractmethods__r)r*r&r�setr')rrr$rerfr.r`r�test_abstractmethod_integration�s*��z=test_factory.<locals>.TestABC.test_abstractmethod_integrationcs�Gdd�d�d��|�t��G�fdd�d���|�t��G�fdd�d��}|�|�jd�Gd	d
�d
t��|�t��G�fdd�d��}Wd�dS1sTwYdS)
Nc@s2eZdZeejdd���Zejejdd���ZdS)zMtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.CcSrrrrrrrr	�rPzQtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.C.foocSrrr�r�valrrrr	�rPN)rrrr"rrIr	�setterrrrrr��rrcrQ)zMtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.Dcrrrrrrrr	�r!zQtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.D.foorRrrTrrr$�rUr$c�eZdZ�jjdd��ZdS)zMtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.EcSrrrrjrrrr	�r
zQtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.E.fooN�rrrr	rlr�r$rrre��rerc@seZdZdd�ZeZdS)zStest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.NotBoolcSst��r)�
ValueErrorrrrr�__bool__�r5z\test_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.NotBool.__bool__N)rrrrs�__len__rrrr�NotBool�srucs$eZdZdd�Z��e_ee�ZdS)zMtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.FcSrrrrrrrr�r
zQtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.F.barN)rrrrr
r"r	r)rurrrf�srf)r)r*r+r	�objectrr)rrerfr.)rr$rur�$test_descriptors_with_abstractmethod�s"�zBtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethodcszG�fdd�d��G�fdd�d�d��|�t��G�fdd�d���|�t��G�fdd	�d	��}|�|jj�dS)
Ncs:eZdZd
dd�Z�fdd�Z�fdd�Zedd	��ZdS)z\test_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.DescriptorNcSs||_||_dSr)�_fget�_fset)r�fget�fsetrrr�__init__�s
zetest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Descriptor.__init__cs�||j�Sr�rx�r�callable��
DescriptorrrrS��zctest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Descriptor.gettercs�|j|�Srr}r~r�rrrl�r�zctest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Descriptor.settercSst|jdd�p
t|jdd�S)Nr
F)r,rxryrrrrr
�s�zqtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Descriptor.__isabstractmethod__r)rrrr|rSrlr"r
rr�rrr��s
r�cs2eZdZ�ejdd���Zejejdd���ZdS)zStest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.CcSrrrrrrrr	�rPzWtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.C.foocSrrrrjrrrr	�rPN)rrrrrIr	rlrr�rrr�rmrrcrQ)zStest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Dcrrrrrrrr	�r!zWtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.D.foorRrrTrrr$�rUr$crn)zStest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.EcSrrrrjrrrr	r
zWtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.E.fooNrorrprrre�rqre)r)r*r'r	r
)rrer.)rr$r�r�*test_customdescriptors_with_abstractmethod�szHtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethodcsJGdd�d�d�}|�|jdh�Gdd�dt|�}Gdd�d|d�}dS)	Nc@r)z;test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.AcSrrrrrrr�xrPz=test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.A.xN)rrrrrIr�rrrr�Arr�rr�c@ra)z>test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.metacSr�N�rrrrrr�r
z@test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.meta.xN)rrrr�rrrr�metarcr�c@�eZdZdS)z;test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.CN�rrrrrrrr�r)r+rgrL)rr�r�rr.rr�test_metaclass_abcsz0test_factory.<locals>.TestABC.test_metaclass_abccsGdd�d�d�}Gdd�dt�}|�}|�t||��|�t||f��|�||�|�||f�|�|�}|�t||��|�t||f��|�||�|�||f�|�||�Gdd�d|�}|�}|�t||��|�t||f��|�||�|�||f�dS)Nc@r�)zAtest_factory.<locals>.TestABC.test_registration_basics.<locals>.ANr�rrrrr�r�r�rc@r�)zAtest_factory.<locals>.TestABC.test_registration_basics.<locals>.BNr�rrrr�Br�r�c@r�)zAtest_factory.<locals>.TestABC.test_registration_basics.<locals>.CNr�rrrrr!r�r)rvr'�
issubclassZassertNotIsInstance�registerr&�assertIsInstance�assertIs)rr�r��b�B1r�cr.rr�test_registration_basicss&
z6test_factory.<locals>.TestABC.test_registration_basicscs�Gdd�d�d�}|jGdd�dt��}|�}|�t||��|�t||f��|�||�|�||f�|jGdd�d|��}|�}|�t||��|�t||f��|�||�|�||f�|�||�|��dS)Nc@r�)zDtest_factory.<locals>.TestABC.test_register_as_class_deco.<locals>.ANr�rrrrr�*r�r�rc@r�)zDtest_factory.<locals>.TestABC.test_register_as_class_deco.<locals>.BNr�rrrrr�,�r�c@r�)zDtest_factory.<locals>.TestABC.test_register_as_class_deco.<locals>.CNr�rrrrr4r�r)r�rvr&r�r�r�)rr�r�r�rr�r.rr�test_register_as_class_deco)s z9test_factory.<locals>.TestABC.test_register_as_class_decocs�Gdd�d�d�}Gdd�d�}|�}|�t||��|�t||f����}|�|���}|�||�|�t||��|�t||f��dS)Nc@r�)zEtest_factory.<locals>.TestABC.test_isinstance_invalidation.<locals>.ANr�rrrrr�?r�r�rc@r�)zEtest_factory.<locals>.TestABC.test_isinstance_invalidation.<locals>.BNr�rrrrr�Ar�r�)r'�
isinstancer�Z
assertGreaterr&)rr�r�r�Z	token_oldZ	token_new�r/�abc_get_cache_tokenrr�test_isinstance_invalidation>s
z:test_factory.<locals>.TestABC.test_isinstance_invalidationcs�Gdd�d�d�}|�t�|�d|�|�d|f�|�tt|��|�tt|f��Gdd�d|�}|�t�Gdd�dt�}|�d	|�|�d	|f�|�tt|��|�tt|f��|�t||��|�t||f��dS)
Nc@r�)zCtest_factory.<locals>.TestABC.test_registration_builtins.<locals>.ANr�rrrrr�Nr�r�r�*c@r�)zCtest_factory.<locals>.TestABC.test_registration_builtins.<locals>.BNr�rrrrr�Ur�r�c@r�)zCtest_factory.<locals>.TestABC.test_registration_builtins.<locals>.CNr�rrrrrX�r�)r��intr�r&r��str�rr�r�rr.rr�test_registration_builtinsMs

z8test_factory.<locals>.TestABC.test_registration_builtinscs�Gdd�d�d�}|�|�Gdd�d|�}|�t|j|�Gdd�dt�}|�|�|�|�Gdd	�d	|�}|�|�|�t|j|�|�|�dS)
Nc@r�)zEtest_factory.<locals>.TestABC.test_registration_edge_cases.<locals>.ANr�rrrrr�ar�r�rc@r�)zFtest_factory.<locals>.TestABC.test_registration_edge_cases.<locals>.A1Nr�rrrr�A1dr�r�c@r�)zEtest_factory.<locals>.TestABC.test_registration_edge_cases.<locals>.BNr�rrrrr�gr�r�c@r�)zEtest_factory.<locals>.TestABC.test_registration_edge_cases.<locals>.CNr�rrrrrkr�r)r�r)�RuntimeErrorrv)rr�r�r�rr.rr�test_registration_edge_cases`s



z:test_factory.<locals>.TestABC.test_registration_edge_casescs(Gdd�d�d�}|�td|jd�dS)Nc@r�)z@test_factory.<locals>.TestABC.test_register_non_class.<locals>.ANr�rrrrr�rr�r�rzCan only register classesr@)rZr*r��rr�r.rr�test_register_non_classqs�z5test_factory.<locals>.TestABC.test_register_non_classcs�Gdd�d�d�}|�t||��|�t||f��Gdd�d�d�}|�t||��|�t||f��|�t||��|�t||f��Gdd�d�d�}|�|�Gdd	�d	|�}|�t||��|�t||f��Gd
d�d|�}|�|�|�t||��|�t||f��|�t||��|�t||f��|�t||��|�t||f��|�t||��|�t||f��|�t||��|�t||f��|�t�Gdd
�d
t�}|�t||��|�t||f��|�d|�|�d|f�dS)Nc@r�)zItest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.ANr�rrrrr�xr�r�rc@r�)zItest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.BNr�rrrrr�|r�r�c@r�)zItest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.CNr�rrrrr�r�rc@r�)zJtest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.B1Nr�rrrrr��r�r�c@r�)zJtest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.C1Nr�rrrr�C1�r�r�c@r�)zMtest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.MyIntNr�rrrr�MyInt�r�r�r�)r&r�r'r�r�r�)rr�r�rr�r�r�r.rr� test_registration_transitivenessws>


z>test_factory.<locals>.TestABC.test_registration_transitivenessc
s�Gdd�d�d�}|�t��
ti|�Wd�n1swY|�t��
td|�Wd�n1s8wYGdd�d�}|�t��t|�|�Wd�n1sZwYddd�d	d�d
d�g}t|�D]?\}�G�fdd�d�d�}|j|d
��"|�t��
tt|�Wd�n1s�wYWd�n1s�wYqod��fdd��G�fdd�d�d�}|�t���tt|�Wd�dS1s�wYdS)Nc@r�)zFtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.ANr�rrrrr��r�r�rr�c@�eZdZdZdS)zFtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.Cr�N)rrr�__mro__rrrrr��rcSsgSrr)r�rrr�<lambda>�rzMtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.<lambda>cSr�Nr�rrrrrr��rcSsdgSr�rrrrrr��sc�eZdZ�ZdS�zFtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.SN�rrr�__subclasses__r)�funcrr�S�r�r�)�izexception from __subclasses__cst���r)�	Exceptionr)�exc_msgrr�	raise_exc�r!zNtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.raise_exccr�r�r�r)r�rrr��r�)r)r*r��	enumerateZsubTestr�rZr�)rr�rZbogus_subclassesr�r�r.)r�r�r�r�test_issubclass_bad_arguments�s>��������"�z;test_factory.<locals>.TestABC.test_issubclass_bad_argumentscs�G�fdd�dtjd��|�t����|�t��f��Gdd�d�}|�t|���|�t|�f��Gdd�d�}|�t|���|�t|�f��dS)NcseZdZe�fdd��ZdS)z:test_factory.<locals>.TestABC.test_subclasshook.<locals>.Acs|�ur	d|jvStS)Nr	)�__dict__�NotImplemented)r2r�r�rr�__subclasshook__�s
zKtest_factory.<locals>.TestABC.test_subclasshook.<locals>.A.__subclasshook__N)rrrr:r�rr�rrr��sr�rc@r�)z:test_factory.<locals>.TestABC.test_subclasshook.<locals>.Br�Nrdrrrrr��r�r�c@r�)z:test_factory.<locals>.TestABC.test_subclasshook.<locals>.Cr�N)rrrZspamrrrrr�r�r)rrMr'r�r&)rr�rrr�r�test_subclasshook�sz/test_factory.<locals>.TestABC.test_subclasshookcs^Gdd�d�d�}G�fdd�dt��Gdd�d|��}|��jd�|�|��jd	�dS)
Nc@r�)zHtest_factory.<locals>.TestABC.test_all_new_methods_are_called.<locals>.ANr�rrrrr��r�r�rcs"eZdZdZ��fdd�Z�ZS)zHtest_factory.<locals>.TestABC.test_all_new_methods_are_called.<locals>.Brcs�jd7_t��|�Sr�)�counterr�__new__r1)r�r rrr��szPtest_factory.<locals>.TestABC.test_all_new_methods_are_called.<locals>.B.__new__)rrrr�r�r#r�r�rrr��sr�c@r�)zHtest_factory.<locals>.TestABC.test_all_new_methods_are_called.<locals>.CNr�rrrrr�r�rrr�)rvr+r�)rr�rr.r�r�test_all_new_methods_are_called�sz=test_factory.<locals>.TestABC.test_all_new_methods_are_calledcSs|�ttjd��dS)N�	__slots__)r&r(rrKrrrr�test_ABC_has___slots__�sz4test_factory.<locals>.TestABC.test_ABC_has___slots__csNdd�}Gdd�d�}Gdd�d�}Gdd�d|�||��}|�|j��dS)	Ncs&G��fdd�dt�}t�|ddi�S)NcseZdZ��fdd�ZdS)z^test_factory.<locals>.TestABC.test_tricky_new_works.<locals>.with_metaclass.<locals>.metaclasscs�|�|�Srr)r2�nameZ
this_bases�d��basesr�rrr��r�zftest_factory.<locals>.TestABC.test_tricky_new_works.<locals>.with_metaclass.<locals>.metaclass.__new__N)rrrr�rr�rrr�srZtemporary_classr)rLr�)r�r�rrr�r�with_metaclass�szKtest_factory.<locals>.TestABC.test_tricky_new_works.<locals>.with_metaclassc@r�)z>test_factory.<locals>.TestABC.test_tricky_new_works.<locals>.ANr�rrrrr��r�r�c@r�)z>test_factory.<locals>.TestABC.test_tricky_new_works.<locals>.BNr�rrrrr��r�r�c@r�)z>test_factory.<locals>.TestABC.test_tricky_new_works.<locals>.CNr�rrrrr�r�r)r+r )rr�r�r�rr.rr�test_tricky_new_works�s
z3test_factory.<locals>.TestABC.test_tricky_new_workscsZGdd�d�d�}|`|�|jdh�|�t|d��t�|�|�|jt��|�dS)Nc@r)z8test_factory.<locals>.TestABC.test_update_del.<locals>.AcSrrrrrrrr	�rPz<test_factory.<locals>.TestABC.test_update_del.<locals>.A.fooN�rrrrrIr	rrrrr��rr�rr	)r	r+rgr'r(r�update_abstractmethodsrhr�r.rr�test_update_del�s

z-test_factory.<locals>.TestABC.test_update_delcsXGdd�d�d�}tjdd��}||_t�|�|�|jddh�d}|�t||�dS)	Nc@r)zHtest_factory.<locals>.TestABC.test_update_new_abstractmethods.<locals>.AcSrrrrrrrrrPzLtest_factory.<locals>.TestABC.test_update_new_abstractmethods.<locals>.A.barN)rrrrrIrrrrrr�rr�rcSrrrrrrr�updated_foorPzRtest_factory.<locals>.TestABC.test_update_new_abstractmethods.<locals>.updated_foor	rz&class A with abstract methods bar, foo)rrIr	r�r+rgrZr*)rr�r�r\r.rr�test_update_new_abstractmethods
s

z=test_factory.<locals>.TestABC.test_update_new_abstractmethodscsrGdd�d�d�}Gdd�d|�}d}|�t||�|�|jdh�dd	�|_t�|�|�|�|jt��dS)
Nc@r)zCtest_factory.<locals>.TestABC.test_update_implementation.<locals>.AcSrrrrrrrr	rPzGtest_factory.<locals>.TestABC.test_update_implementation.<locals>.A.fooNr�rrrrr�rr�rc@r�)zCtest_factory.<locals>.TestABC.test_update_implementation.<locals>.BNr�rrrrr�#r�r�� class B with abstract method foor	cSrrrrrrrr�*rzJtest_factory.<locals>.TestABC.test_update_implementation.<locals>.<lambda>)rZr*r+rgr	rr�rh�rr�r�r\r.rr�test_update_implementations

z8test_factory.<locals>.TestABC.test_update_implementationcsNGdd�d�d�}dd�}tj|Gdd�d|���}|�|�|jt��dS)Nc@r)zAtest_factory.<locals>.TestABC.test_update_as_decorator.<locals>.AcSrrrrrrrr	3rPzEtest_factory.<locals>.TestABC.test_update_as_decorator.<locals>.A.fooNr�rrrrr�2rr�rcSsdd�|_|S)NcSrrrrrrrr�8rzatest_factory.<locals>.TestABC.test_update_as_decorator.<locals>.class_decorator.<locals>.<lambda>)r	r1rrr�class_decorator7s
zOtest_factory.<locals>.TestABC.test_update_as_decorator.<locals>.class_decoratorc@r�)zAtest_factory.<locals>.TestABC.test_update_as_decorator.<locals>.BNr�rrrrr�;sr�)rr�r+rgrh)rr�r�r�r.rr�test_update_as_decorator1sz6test_factory.<locals>.TestABC.test_update_as_decoratorcSsFGdd�d�}tjdd��}||_t�|�|�|�t|d��dS)Nc@r�)z<test_factory.<locals>.TestABC.test_update_non_abc.<locals>.ANr�rrrrr�Dr�r�cSrrrrrrrr�GrPzFtest_factory.<locals>.TestABC.test_update_non_abc.<locals>.updated_foorg)rrIr	r�r'r()rr�r�rrr�test_update_non_abcCs

z1test_factory.<locals>.TestABC.test_update_non_abccsLGdd�d�d�}Gdd�d|�}|�|`t�|�d}|�t||�dS)Nc@r)zGtest_factory.<locals>.TestABC.test_update_del_implementation.<locals>.AcSrrrrrrrr	RrPzKtest_factory.<locals>.TestABC.test_update_del_implementation.<locals>.A.fooNr�rrrrr�Qrr�rc@ra)zGtest_factory.<locals>.TestABC.test_update_del_implementation.<locals>.BcSrrrrrrrr	Wr
zKtest_factory.<locals>.TestABC.test_update_del_implementation.<locals>.B.fooNrdrrrrr�Vrcr�r��r	rr�rZr*r�r.rr�test_update_del_implementationPs
z<test_factory.<locals>.TestABC.test_update_del_implementationcs\Gdd�d�d�}Gdd�d|�}Gdd�d|�}|�|`t�|�d}|�t||�dS)	Nc@r)zKtest_factory.<locals>.TestABC.test_update_layered_implementation.<locals>.AcSrrrrrrrr	erPzOtest_factory.<locals>.TestABC.test_update_layered_implementation.<locals>.A.fooNr�rrrrr�drr�rc@r�)zKtest_factory.<locals>.TestABC.test_update_layered_implementation.<locals>.BNr�rrrrr�ir�r�c@ra)zKtest_factory.<locals>.TestABC.test_update_layered_implementation.<locals>.CcSrrrrrrrr	mr
zOtest_factory.<locals>.TestABC.test_update_layered_implementation.<locals>.C.fooNrdrrrrrlrcrz class C with abstract method foor�)rr�r�rr\r.rr�"test_update_layered_implementationcs
z@test_factory.<locals>.TestABC.test_update_layered_implementationcsnGdd�d�d�}Gdd�d�d�}Gdd�d||�}|�|jdh�|`t�|�|�|jt��|�dS)	Nc@r)zFtest_factory.<locals>.TestABC.test_update_multi_inheritance.<locals>.AcSrrrrrrrr	{rPzJtest_factory.<locals>.TestABC.test_update_multi_inheritance.<locals>.A.fooNr�rrrrr�zrr�rc@ra)zFtest_factory.<locals>.TestABC.test_update_multi_inheritance.<locals>.BcSrrrrrrrr	�r
zJtest_factory.<locals>.TestABC.test_update_multi_inheritance.<locals>.B.fooNrdrrrrr�rcr�c@r)zFtest_factory.<locals>.TestABC.test_update_multi_inheritance.<locals>.CcSrrrrrrrr	�rPzJtest_factory.<locals>.TestABC.test_update_multi_inheritance.<locals>.C.fooNr�rrrrr�rrr	)r+rgr	rr�rhr�r.rr�test_update_multi_inheritanceys

z;test_factory.<locals>.TestABC.test_update_multi_inheritanceN)"rrrrNrOr0r;rDr]r_rirwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rr�TestABCHs@

'0
r�cseZdZ�fdd�ZdS)z-test_factory.<locals>.TestABCWithInitSubclassc	s\Gdd�d�d�}i�G�fdd�d�}Gdd�d||dd	d
d�}|��tdd	d
d��dS)Nc@r�)z\test_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclass.<locals>.abc_ABCrN)rrrr�rrrr�abc_ABC�r�r�rcseZdZ��fdd�Z�ZS)zhtest_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclass.<locals>.ReceivesClassKwargscst�����|�dSr)r�__init_subclass__�update)r2�kwargs)r �saved_kwargsrrr��s
zztest_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclass.<locals>.ReceivesClassKwargs.__init_subclass__)rrrr�r#r�r�rr�ReceivesClassKwargs�sr�c@r�)z]test_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclass.<locals>.ReceiverNr�rrrr�Receiver�r�r�r��r)r��y�z)r+�dict)rr�r�r�r.r�r�test_works_with_init_subclass�s
zKtest_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclassN)rrrr�rr.rr�TestABCWithInitSubclass�sr�)�unittestZTestCase)r/r�rEr�r�rr�r�test_factorys8O
r��__main__)�__doc__r�rZ_py_abc�inspectrr�rM�get_cache_tokenZTestLegacyAPI_PyZ
TestABC_PyZTestABCWithInitSubclass_PyZTestLegacyAPI_CZ	TestABC_CZTestABCWithInitSubclass_Cr�mainrrrr�<module>s(
�
��
© 2025 GrazzMean