HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_abc.cpython-37.opt-1.pyc
B

��gH�@sldZddlZddlZddlZddlmZdd�Zeejej�\Z	Z
Zeejej�\ZZ
Zedkrhe��dS)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)
NcSsdS)N�)�selfrr�)/usr/local/lib/python3.7/test/test_abc.py�fooszMtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.foocSsdS)Nr)rrrr�bar�zMtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.bar�__isabstractmethod__c@seZdZejdd��ZdS)zKtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.CcSsdS)N�r)rrrrrszOtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.C.fooN)�__name__�
__module__�__qualname__�abc�abstractpropertyrrrrr�Csr)�	metaclasscs eZdZe�fdd��Z�ZS)zKtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.Dcst�jS)N)�superr)r)�	__class__rrrszOtest_factory.<locals>.TestLegacyAPI.test_abstractproperty_basics.<locals>.D.foo)rrr
�propertyr�
__classcell__rr)rr�Dsrr
F)rr�
assertTruer	�assertFalse�hasattr�assertRaises�	TypeError�assertEqualr�getattr)rrrrr)�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)NcSsdS)Nr)�clsrrrr$szPtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.foocSsdS)Nr)r rrrr'szPtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.barr	Fc@seZdZejdd��ZdS)zNtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.CcSs|jS)N)r)r rrrr,szRtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.C.fooN)rrr
r�abstractclassmethodrrrrrr+sr)rcs eZdZe�fdd��Z�ZS)zNtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.Dcs
t���S)N)rr)r )rrrr0szRtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basics.<locals>.D.foo)rrr
�classmethodrrrr)rrr/sr)rr!rr	r"rrrrrr)rrrrr)rrr�test_abstractclassmethod_basics#szCtest_factory.<locals>.TestLegacyAPI.test_abstractclassmethod_basicscs�tjdd��}|�|j�tdd��}|�t|dd��Gdd�d�d	�}|�t|�Gd
d�d|�}|�	|�
�d�|�	|��
�d�dS)
NcSsdS)Nrrrrrr6szQtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.foocSsdS)Nrrrrrr9szQtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.barr	Fc@seZdZejdd��ZdS)zOtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.CcSsdS)Nr
rrrrrr>szStest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.C.fooN)rrr
r�abstractstaticmethodrrrrrr=sr)rc@seZdZedd��ZdS)zOtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.DcSsdS)N�rrrrrrBszStest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basics.<locals>.D.fooN)rrr
�staticmethodrrrrrrAsrr%)rr$rr	r&rrrrrr)rrrrr)rrr� test_abstractstaticmethod_basics5szDtest_factory.<locals>.TestLegacyAPI.test_abstractstaticmethod_basicsN)rrr
rr#r'r)rrr�
TestLegacyAPIsr(cs�eZdZdd�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$�Zd%d&�Z�fd'd(�Zd)S)*ztest_factory.<locals>.TestABCcSsTGdd�dtj�}|�t|�tj�|�t|�Gdd�d|�}|�|��d�dS)Nc@seZdZeejdd���ZdS)z8test_factory.<locals>.TestABC.test_ABC_helper.<locals>.CcSs|jS)N)r)r rrrrMsz<test_factory.<locals>.TestABC.test_ABC_helper.<locals>.C.fooN)rrr
r"r�abstractmethodrrrrrrLsrcs eZdZe�fdd��Z�ZS)z8test_factory.<locals>.TestABC.test_ABC_helper.<locals>.Dcs
t���S)N)rr)r )rrrrSsz<test_factory.<locals>.TestABC.test_ABC_helper.<locals>.D.foo)rrr
r"rrrr)rrrRsr)r�ABCr�type�ABCMetarrr)rrrrrr�test_ABC_helperJs
z-test_factory.<locals>.TestABC.test_ABC_helpercSs6tjdd��}|�|j�dd�}|�t|d��dS)NcSsdS)Nr)rrrrrXszEtest_factory.<locals>.TestABC.test_abstractmethod_basics.<locals>.foocSsdS)Nr)rrrrr[rzEtest_factory.<locals>.TestABC.test_abstractmethod_basics.<locals>.barr	)rr)rr	rr)rrrrrr�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)
NcSsdS)Nr)rrrrr_szGtest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.foocSsdS)Nr)rrrrrcrzGtest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.barr	Fc@seZdZeejdd���ZdS)zEtest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.CcSsdS)Nr
r)rrrrrgszItest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.C.fooN)rrr
rrr)rrrrrrfsr)rcs$eZdZ�jj�fdd��Z�ZS)zEtest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.Dcst�jS)N)rr)r)rrrrlszItest_factory.<locals>.TestABC.test_abstractproperty_basics.<locals>.D.foo)rrr
r�getterrr)r)rrrksrr
)rrr)rr	rrrrrr)rrrr)r)rrr^sz:test_factory.<locals>.TestABC.test_abstractproperty_basicscs�ttjdd���}|�|j�tdd��}|�t|dd��Gdd�d�d	�}|�t|�Gd
d�d|�}|�	|�
�d�|�	|��
�d�dS)NcSsdS)Nr)r rrrrqszJtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.foocSsdS)Nr)r rrrruszJtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.barr	Fc@seZdZeejdd���ZdS)zHtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.CcSs|jS)N)r)r rrrrzszLtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.C.fooN)rrr
r"rr)rrrrrrysr)rcs eZdZe�fdd��Z�ZS)zHtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.Dcs
t���S)N)rr)r )rrrrszLtest_factory.<locals>.TestABC.test_abstractclassmethod_basics.<locals>.D.foo)rrr
r"rrrr)rrr~sr)r"rr)rr	rrrrrr)rrrrr)rrrr#psz=test_factory.<locals>.TestABC.test_abstractclassmethod_basicscs�ttjdd���}|�|j�tdd��}|�t|dd��Gdd�d�d	�}|�t|�Gd
d�d|�}|�	|�
�d�|�	|��
�d�dS)
NcSsdS)Nrrrrrr�szKtest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.foocSsdS)Nrrrrrr�szKtest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.barr	Fc@seZdZeejdd���ZdS)zItest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.CcSsdS)Nr
rrrrrr�szMtest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.C.fooN)rrr
r&rr)rrrrrr�sr)rc@seZdZedd��ZdS)zItest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.DcSsdS)Nr%rrrrrr�szMtest_factory.<locals>.TestABC.test_abstractstaticmethod_basics.<locals>.D.fooN)rrr
r&rrrrrr�srr%)r&rr)rr	rrrrrr)rrrrr)rrrr'�sz>test_factory.<locals>.TestABC.test_abstractstaticmethod_basicscs�xtjtjtjtjgD]�G�fdd�d�d�}|�|jdh�|�t|�|�	t
|��Gdd�d|�}|�|jdh�|�t|�|�	t
|��Gdd�d|�}|�|jt��|�|�t
|��G�fd	d
�d
|�}|�|jdh�|�t|�|�	t
|��qWdS)Ncs eZdZ�dd��Zdd�ZdS)zHtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.CcSsdS)Nr)rrrrr�szLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.C.foocSsdS)Nr)rrrrr�rzLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.C.barN)rrr
rrr)�
abstractthingrrr�sr)rrc@seZdZdd�ZdS)zHtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.DcSsdS)Nr)rrrrr�rzLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.D.barN)rrr
rrrrrr�src@seZdZdd�ZdS)zHtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.EcSsdS)Nr)rrrrr�rzLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.E.fooN)rrr
rrrrr�E�sr1cseZdZ�dd��ZdS)zHtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.FcSsdS)Nr)rrrrr�szLtest_factory.<locals>.TestABC.test_abstractmethod_integration.<locals>.F.barN)rrr
rr)r0rr�F�sr2r)
rr)rr!r$r�__abstractmethods__rrrr�setr)rrrr1r2)r)r0r�test_abstractmethod_integration�s&z=test_factory.<locals>.TestABC.test_abstractmethod_integrationc	s�Gdd�d�d��|�t��G�fdd�d���|�t��G�fdd�d��}|�|�jd�Gd	d
�d
t��|�t��G�fdd�d��}WdQRXdS)
Nc@s2eZdZeejdd���Zejejdd���ZdS)zMtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.CcSsdS)Nr
r)rrrrr�szQtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.C.foocSsdS)Nr)r�valrrrr�sN)rrr
rrr)r�setterrrrrr�sr)rcs$eZdZ�jj�fdd��Z�ZS)zMtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.Dcst�jS)N)rr)r)rrrr�szQtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.D.foo)rrr
rr/rr)r)rrr�srcseZdZ�jjdd��ZdS)zMtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.EcSsdS)Nr)rr6rrrr�szQtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.E.fooN)rrr
rr7r)rrrr1�sr1r
c@seZdZdd�ZeZdS)zStest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.NotBoolcSs
t��dS)N)�
ValueError)rrrr�__bool__�sz\test_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.NotBool.__bool__N)rrr
r9�__len__rrrr�NotBool�sr;cs$eZdZdd�Z��e_ee�ZdS)zMtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.FcSsdS)Nr)rrrrr�szQtest_factory.<locals>.TestABC.test_descriptors_with_abstractmethod.<locals>.F.barN)rrr
rr	rrr)r;rrr2�sr2)rrrr�objectr8)rr1r2)r)rrr;r�$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||_||_dS)N)�_fget�_fset)r�fget�fsetrrr�__init__�szetest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Descriptor.__init__cs�||j�S)N)r>)r�callable)�
Descriptorrrr/�szctest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Descriptor.gettercs�|j|�S)N)r>)rrC)rDrrr7�szctest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Descriptor.settercSst|jdd�pt|jdd�S)Nr	F)rr>r?)rrrrr	�szqtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Descriptor.__isabstractmethod__)N)rrr
rBr/r7rr	r)rDrrrD�s
rDcs2eZdZ�ejdd���Zejejdd���ZdS)zStest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.CcSsdS)Nr
r)rrrrr�szWtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.C.foocSsdS)Nr)rr6rrrr�sN)rrr
rr)rr7r)rDrrr�sr)rcs$eZdZ�jj�fdd��Z�ZS)zStest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.Dcst�jS)N)rr)r)rrrr�szWtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.D.foo)rrr
rr/rr)r)rrr�srcseZdZ�jjdd��ZdS)zStest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.EcSsdS)Nr)rr6rrrr�szWtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethod.<locals>.E.fooN)rrr
rr7r)rrrr1�sr1)rrrrr	)rr1)r)rrrDr�*test_customdescriptors_with_abstractmethod�szHtest_factory.<locals>.TestABC.test_customdescriptors_with_abstractmethodcsJGdd�d�d�}|�|jdh�Gdd�dt|�}Gdd�d|d�}dS)	Nc@seZdZejdd��ZdS)z;test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.AcSsdS)Nr)rrrr�x�sz=test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.A.xN)rrr
rr)rFrrrr�A�srG)rrFc@seZdZdd�ZdS)z>test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.metacSsdS)N�r)rrrrrF�sz@test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.meta.xN)rrr
rFrrrr�meta�srIc@seZdZdS)z;test_factory.<locals>.TestABC.test_metaclass_abc.<locals>.CN)rrr
rrrrr�sr)rr3r+)rrGrIr)rrr�test_metaclass_abc�sz0test_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@seZdZdS)zAtest_factory.<locals>.TestABC.test_registration_basics.<locals>.AN)rrr
rrrrrG�srG)rc@seZdZdS)zAtest_factory.<locals>.TestABC.test_registration_basics.<locals>.BN)rrr
rrrr�BsrKc@seZdZdS)zAtest_factory.<locals>.TestABC.test_registration_basics.<locals>.CN)rrr
rrrrrsr)r<r�
issubclassZassertNotIsInstance�registerr�assertIsInstance�assertIs)rrGrK�b�B1r�c)rrr�test_registration_basics�s&
z6test_factory.<locals>.TestABC.test_registration_basicscs�Gdd�d�d�}|jGdd�dt��}|�}|�t||��|�t||f��|�||�|�||f�|jGdd�d|��}|�}|�t||��|�t||f��|�||�|�||f�|�||�|��dS)Nc@seZdZdS)zDtest_factory.<locals>.TestABC.test_register_as_class_deco.<locals>.AN)rrr
rrrrrGsrG)rc@seZdZdS)zDtest_factory.<locals>.TestABC.test_register_as_class_deco.<locals>.BN)rrr
rrrrrKsrKc@seZdZdS)zDtest_factory.<locals>.TestABC.test_register_as_class_deco.<locals>.CN)rrr
rrrrr!sr)rMr<rrLrNrO)rrGrKrPrrR)rrr�test_register_as_class_decos z9test_factory.<locals>.TestABC.test_register_as_class_decocs�Gdd�d�d�}Gdd�d�}|�}|�t||��|�t||f����}|�|���}|�||�|�t||��|�t||f��dS)Nc@seZdZdS)zEtest_factory.<locals>.TestABC.test_isinstance_invalidation.<locals>.AN)rrr
rrrrrG,srG)rc@seZdZdS)zEtest_factory.<locals>.TestABC.test_isinstance_invalidation.<locals>.BN)rrr
rrrrrK.srK)r�
isinstancerMZassertNotEqualr)rrGrKrPZ	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@seZdZdS)zCtest_factory.<locals>.TestABC.test_registration_builtins.<locals>.AN)rrr
rrrrrG;srG)r�*c@seZdZdS)zCtest_factory.<locals>.TestABC.test_registration_builtins.<locals>.BN)rrr
rrrrrKBsrKc@seZdZdS)zCtest_factory.<locals>.TestABC.test_registration_builtins.<locals>.CN)rrr
rrrrrEsr�)rM�intrNrrL�str)rrGrKr)rrr�test_registration_builtins:s

z8test_factory.<locals>.TestABC.test_registration_builtinscs�Gdd�d�d�}|�|�Gdd�d|�}|�t|j|�Gdd�dt�}|�|�|�|�Gdd	�d	|�}|�|�|�t|j|�|�|�dS)
Nc@seZdZdS)zEtest_factory.<locals>.TestABC.test_registration_edge_cases.<locals>.AN)rrr
rrrrrGNsrG)rc@seZdZdS)zFtest_factory.<locals>.TestABC.test_registration_edge_cases.<locals>.A1N)rrr
rrrr�A1Qsr]c@seZdZdS)zEtest_factory.<locals>.TestABC.test_registration_edge_cases.<locals>.BN)rrr
rrrrrKTsrKc@seZdZdS)zEtest_factory.<locals>.TestABC.test_registration_edge_cases.<locals>.CN)rrr
rrrrrXsr)rMr�RuntimeErrorr<)rrGr]rKr)rrr�test_registration_edge_casesMs



z:test_factory.<locals>.TestABC.test_registration_edge_casescs(Gdd�d�d�}|�td|jd�dS)Nc@seZdZdS)z@test_factory.<locals>.TestABC.test_register_non_class.<locals>.AN)rrr
rrrrrG_srG)rzCan only register classesr%)�assertRaisesRegexrrM)rrG)rrr�test_register_non_class^sz5test_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@seZdZdS)zItest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.AN)rrr
rrrrrGesrG)rc@seZdZdS)zItest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.BN)rrr
rrrrrKisrKc@seZdZdS)zItest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.CN)rrr
rrrrrosrc@seZdZdS)zJtest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.B1N)rrr
rrrrrQrsrQc@seZdZdS)zJtest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.C1N)rrr
rrrr�C1vsrbc@seZdZdS)zMtest_factory.<locals>.TestABC.test_registration_transitiveness.<locals>.MyIntN)rrr
rrrr�MyInt�srcrX)rrLrrMrZrN)rrGrKrrQrbrc)rrr� test_registration_transitivenessds>


z>test_factory.<locals>.TestABC.test_registration_transitivenesscsJGdd�d�d�}|�t��ti|�WdQRX|�t��td|�WdQRXGdd�d�}|�t��t|�|�WdQRXddd�d	d�d
d�g}xbt|�D]V\}�G�fdd�d�d�}|j|d
��&|�t��tt|�WdQRXWdQRXq�Wd��fdd��G�fdd�d�d�}|�t���tt|�WdQRXdS)Nc@seZdZdS)zFtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.AN)rrr
rrrrrG�srG)rrXc@seZdZdZdS)zFtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.CrXN)rrr
�__mro__rrrrr�srcSsgS)Nr)rFrrr�<lambda>�rzMtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.<lambda>cSsdS)NrXrrrrrrf�rcSsdgS)NrXrrrrrrf�rcseZdZ�ZdS)zFtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.SN)rrr
�__subclasses__r)�funcrr�S�sri)�izexception from __subclasses__cst���dS)N)�	Exceptionr)�exc_msgrr�	raise_exc�szNtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.raise_exccseZdZ�ZdS)zFtest_factory.<locals>.TestABC.test_issubclass_bad_arguments.<locals>.SN)rrr
rgr)rmrrri�s)rrrL�	enumerateZsubTestrZr`rk)rrGrZbogus_subclassesrjri)r)rlrhrmr�test_issubclass_bad_arguments�s,
"z;test_factory.<locals>.TestABC.test_issubclass_bad_argumentscs^Gdd�d�d�}G�fdd�dt��Gdd�d|��}|��jd�|�|��jd	�dS)
Nc@seZdZdS)zHtest_factory.<locals>.TestABC.test_all_new_methods_are_called.<locals>.AN)rrr
rrrrrG�srG)rcs"eZdZdZ��fdd�Z�ZS)zHtest_factory.<locals>.TestABC.test_all_new_methods_are_called.<locals>.Brcs�jd7_t��|�S)NrH)�counterr�__new__)r )rKrrrrq�szPtest_factory.<locals>.TestABC.test_all_new_methods_are_called.<locals>.B.__new__)rrr
rprqrr)rK)rrrK�srKc@seZdZdS)zHtest_factory.<locals>.TestABC.test_all_new_methods_are_called.<locals>.CN)rrr
rrrrr�srrrH)r<rrp)rrGr)r)rKr�test_all_new_methods_are_called�sz=test_factory.<locals>.TestABC.test_all_new_methods_are_calledcSs|�ttjd��dS)N�	__slots__)rrrr*)rrrr�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�|�|�S)Nr)r �nameZ
this_bases�d)�basesrIrrrq�szftest_factory.<locals>.TestABC.test_tricky_new_works.<locals>.with_metaclass.<locals>.metaclass.__new__N)rrr
rqr)rwrIrrr�srZtemporary_classr)r+rq)rIrwrr)rwrIr�with_metaclass�szKtest_factory.<locals>.TestABC.test_tricky_new_works.<locals>.with_metaclassc@seZdZdS)z>test_factory.<locals>.TestABC.test_tricky_new_works.<locals>.AN)rrr
rrrrrG�srGc@seZdZdS)z>test_factory.<locals>.TestABC.test_tricky_new_works.<locals>.BN)rrr
rrrrrK�srKc@seZdZdS)z>test_factory.<locals>.TestABC.test_tricky_new_works.<locals>.CN)rrr
rrrrr�sr)rr)rrxrGrKr)rrr�test_tricky_new_works�s
z3test_factory.<locals>.TestABC.test_tricky_new_worksN)rrr
r-r.rr#r'r5r=rErJrSrTrWr\r_rardrorrrtryr)rrVrr�TestABCHs(

'0rzcseZdZ�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@seZdZdZdS)z\test_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclass.<locals>.abc_ABCrN)rrr
rsrrrr�abc_ABC�sr{)rcseZdZ��fdd�Z�ZS)zhtest_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclass.<locals>.ReceivesClassKwargscst�����|�dS)N)r�__init_subclass__�update)r �kwargs)r�saved_kwargsrrr|�s
zztest_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclass.<locals>.ReceivesClassKwargs.__init_subclass__)rrr
r|rr)r)rr�ReceivesClassKwargs�sr�c@seZdZdS)z]test_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclass.<locals>.ReceiverN)rrr
rrrr�Receiver�sr�rH�r
)rF�y�z)r�dict)rr{r�r�)r)rr�test_works_with_init_subclass�s
zKtest_factory.<locals>.TestABCWithInitSubclass.test_works_with_init_subclassN)rrr
r�r)rrr�TestABCWithInitSubclass�sr�)�unittestZTestCase)rrVr(rzr�r)rrVr�test_factorys8r��__main__)�__doc__r�rZ_py_abc�inspectrr�r,�get_cache_tokenZTestLegacyAPI_PyZ
TestABC_PyZTestABCWithInitSubclass_PyZTestLegacyAPI_CZ	TestABC_CZTestABCWithInitSubclass_Cr�mainrrrr�<module>s[