Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/test_module.cpython-38.opt-2.pyc
U

>��g5)�@s~ddlZddlZddlmZmZddlmZddlZee�Z	Gdd�d�Z
Gdd�d�ZGdd	�d	ej�Z
ed
krze��dS)�N)�
gc_collect�requires_type_collecting)�assert_python_okc@seZdZedd��ZdS)�
FullLoadercCsd�|j�S)Nz<module '{}' (crafted)>)�format�__name__)�cls�m�r
�//opt/cppython/lib/python3.8/test/test_module.py�module_reprszFullLoader.module_reprN)r�
__module__�__qualname__�classmethodrr
r
r
rr
src@seZdZdS)�
BareLoaderN)rr
rr
r
r
rrsrc@seZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edd��Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zed9d:��Z d;d<�Z!d=S)>�ModuleTestscCsnt�t�}|�|jdk�|�tt|�z|j}|�dt	|��Wnt
k
rXYnX|�|jtj�dS)Nz
__name__ = %s)
�
ModuleType�__new__�
assertTrue�__dict__�assertRaises�SystemError�dirrZfail�repr�AttributeError�assertEqual�__doc__)�self�foo�sr
r
r�test_uninitializeds
zModuleTests.test_uninitializedcCs t�t�}|�tdt|d�dS)Nz"module has no attribute 'not_here'�not_here)rr�assertRaisesRegexr�getattr�rrr
r
r�"test_uninitialized_missing_getattr!s
�z.ModuleTests.test_uninitialized_missing_getattrcCstd�}|�tdt|d�dS)Nrz(module 'foo' has no attribute 'not_here'r!)rr"rr#r$r
r
r�test_missing_getattr)s�z ModuleTests.test_missing_getattrc	Csltd�}|�|jd�|�|jd�|�|jd�|�|jd�|�|jd�|�|jdddddd��dS)Nr�rr�
__loader__�__package__�__spec__)	rrrr�assertIsr(r)r*rr$r
r
r�test_no_docstring1s�zModuleTests.test_no_docstringc	CsDtdd�}|�|jd�|�|jd�|�|jdddddd��dS)Nr�foodocr'�rrrrrr$r
r
r�test_ascii_docstring=s
��z ModuleTests.test_ascii_docstringc	CsDtdd�}|�|jd�|�|jd�|�|jdddddd��dS)Nr�	foodocሴr'r.r$r
r
r�test_unicode_docstringGs
��z"ModuleTests.test_unicode_docstringc
Cs|tdd�}d|_|j}|�dd�|�|jd�|�|jd�|�|jd�|�|jddddddd��|�|j|k�dS)Nrr0�*r-)rr�barr(r)r*)rr3r�__init__rrrr)rr�dr
r
r�test_reinitQs
��zModuleTests.test_reinitcCs&dd�}t�|�|�jdd�dS)NcSstd�}d|_|S)Nr�)rr3)rr
r
r�fasz+ModuleTests.test_dont_clear_dict.<locals>.fr3r7)rrr)rr8r
r
r�test_dont_clear_dict_sz ModuleTests.test_dont_clear_dictcCs<g}td�}||_d}t||j�~t�|�|dg�dS)Nrzwclass A:
    def __init__(self, l):
        self.l = l
    def __del__(self):
        self.l.append(1)
a = A(destroyed)�)r�	destroyed�execrrr)rr;r	rr
r
r�test_clear_dict_in_ref_cyclehsz(ModuleTests.test_clear_dict_in_ref_cyclecCs:td�}t�|�}|�|�|�~t�|�|�d�dS)Nr)r�weakref�refr+r)rr	�wrr
r
r�test_weakrefxs
zModuleTests.test_weakrefc	Csxddlm}ddlm}|�|d�|�|jd�|�|jd�|�td��|jW5QRX|�|j	d�t
jd=dS)	Nr)�testz
There is testr:�z Deprecated, use whatever insteadzThere is whatever�test.good_getattr)�test.good_getattr�good_getattrrBr�x�yr"rZyoloZwhatever�sys�modules)r�ggarBr
r
r�test_module_getattr�s�zModuleTests.test_module_getattrc	Cs�ddlm}ddlm}|�|jd�|�|jd�|�t��|jW5QRX|�t��|jW5QRXt	j
d=dt	j
kr�t	j
d=dS)Nr��bad_getattr2r:�test.bad_getattr�test.bad_getattr2)�test.bad_getattr�bad_getattrrBrNrrGr�	TypeErrorZnoperIrJ�rZbgarNr
r
r�test_module_getattr_errors�s
z&ModuleTests.test_module_getattr_errorscCs.ddlm}|�t|�dddg�tjd=dS)Nr�a�b�crD)rErFrrrIrJ)rrKr
r
r�test_module_dir�szModuleTests.test_module_dirc	Csrddlm}ddlm}|�t��t|�W5QRX|�t��t|�W5QRXtjd=dtjkrntjd=dS)NrrMrOrP)	rQrRrBrNrrSrrIrJrTr
r
r�test_module_dir_errors�s
z"ModuleTests.test_module_dir_errorsc	CsZddlm}|�t��|jW5QRX|�t��|jW5QRXdtjkrVtjd=dS)Nr)�bad_getattr3ztest.bad_getattr3)rBr[rrZoneZ
delgetattrrIrJ)rr[r
r
r�test_module_getattr_tricky�s
z&ModuleTests.test_module_getattr_trickycCs td�}|`|�t|�d�dS)Nrz<module '?'>)rrrr�rr	r
r
r�test_module_repr_minimal�sz$ModuleTests.test_module_repr_minimalcCstd�}|�t|�d�dS�Nrz<module 'foo'>�rrrr]r
r
r�test_module_repr_with_name�sz&ModuleTests.test_module_repr_with_namecCs"td�}d|_|�t|�d�dS�Nr�/tmp/foo.pyz!<module 'foo' from '/tmp/foo.py'>)r�__file__rrr]r
r
r�'test_module_repr_with_name_and_filename�sz3ModuleTests.test_module_repr_with_name_and_filenamecCs&td�}|`d|_|�t|�d�dS)Nrrcz<module '?' from '/tmp/foo.py'>)rrrdrrr]r
r
r�#test_module_repr_with_filename_only�sz/ModuleTests.test_module_repr_with_filename_onlycCstd�}|�t|�d�dSr_r`r]r
r
r�$test_module_repr_with_loader_as_None�sz0ModuleTests.test_module_repr_with_loader_as_NonecCs4td�}|`t|_tt�}|�t|�d�|��dS�Nrz<module '?' ({})>)rrrr(rrr�rr	Zloader_reprr
r
r�-test_module_repr_with_bare_loader_but_no_name�s�z9ModuleTests.test_module_repr_with_bare_loader_but_no_namecCs4td�}|`t|_tt�}|�t|�d�|��dSrh)rrrr(rrrrir
r
r�-test_module_repr_with_full_loader_but_no_name�s�z9ModuleTests.test_module_repr_with_full_loader_but_no_namecCs0td�}t|_tt�}|�t|�d�|��dS)Nrz<module 'foo' ({})>)rrr(rrr)rr	rr
r
r�!test_module_repr_with_bare_loader�s�z-ModuleTests.test_module_repr_with_bare_loadercCs"td�}t|_|�t|�d�dS)Nr�<module 'foo' (crafted)>)rrr(rrr]r
r
r�!test_module_repr_with_full_loader�s�z-ModuleTests.test_module_repr_with_full_loadercCs(td�}t|_d|_|�t|�d�dSrb)rrr(rdrrr]r
r
r�.test_module_repr_with_bare_loader_and_filename�sz:ModuleTests.test_module_repr_with_bare_loader_and_filenamecCs(td�}t|_d|_|�t|�d�dS)Nrrcrm)rrr(rdrrr]r
r
r�.test_module_repr_with_full_loader_and_filename�sz:ModuleTests.test_module_repr_with_full_loader_and_filenamecCs|�tt�d�dS)Nz<module 'sys' (built-in)>)rrrI)rr
r
r�test_module_repr_builtinsz$ModuleTests.test_module_repr_builtincCsZtt�}d}d}|�|dt|��|d�||��|�|t|�d�|d�||��dS)Nz<module 'unittest' from 'z
__init__.py'>z{!r} does not start with {!r}z{!r} does not end with {!r})r�unittestr�lenr)r�rZstarts_withZ	ends_withr
r
r�test_module_repr_sources
�
�z#ModuleTests.test_module_repr_sourcec	CsBtdd�\}}}|�|�|��}|�t|�ddddddh�dS)	Nz-czfrom test import final_asx = asx = bs
final_a.x = as
final_b.x = bs	len = lensshutil.rmtree = rmtree)rZassertFalse�
splitlinesr�set)r�rc�out�err�linesr
r
r�$test_module_finalization_at_shutdown
s

�z0ModuleTests.test_module_finalization_at_shutdowncs:Gdd�d��G�fdd�dt�}|�tt|d�d�dS)Nc@seZdZdd�ZdS)z;ModuleTests.test_descriptor_errors_propagate.<locals>.DescrcSst�dS)N)�RuntimeError)r�o�tr
r
r�__get__szCModuleTests.test_descriptor_errors_propagate.<locals>.Descr.__get__N)rr
rr�r
r
r
r�Descrsr�cseZdZ��ZdS)z7ModuleTests.test_descriptor_errors_propagate.<locals>.MN)rr
r�melonr
�r�r
r�Msr�Zmymodr�)rrr}r#)rr�r
r�r� test_descriptor_errors_propagatesz,ModuleTests.test_descriptor_errors_propagateN)"rr
rr r%r&r,r/r1r6r9rr=rArLrUrYrZr\r^rarerfrgrjrkrlrnrorprqrur|r�r
r
r
rrs@


	


		

r�__main__)rrr>Ztest.supportrrZtest.support.script_helperrrI�typerrrZTestCaserr�mainr
r
r
r�<module>s

F1le Man4ger