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

name : test_module.cpython-310.pyc
o

abx1�@s�ddlZddlZddlmZddlmZddlmZddlZee�Z	Gdd�d�Z
Gdd�d�ZGd	d
�d
ej�Z
edkrCe��dSdS)�N)�
gc_collect)�
import_helper)�assert_python_okc@seZdZedd��ZdS)�
FullLoadercCsd�|j�S)Nz<module '{}' (crafted)>)�format�__name__)�cls�m�r
�9/usr/local/python-3.10/lib/python3.10/test/test_module.py�module_reprszFullLoader.module_reprN)r�
__module__�__qualname__�classmethodrr
r
r
rrsrc@seZdZdS)�
BareLoaderN)rr
rr
r
r
rrsrc@seZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dES)F�ModuleTestscCslt�t�}|�|jdu�|�tt|�z|j}|�dt	|��Wn	t
y+Ynw|�|jtj�dS)Nz
__name__ = %s)
�
ModuleType�__new__�
assertTrue�__dict__�assertRaises�	TypeError�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_docstring2s�zModuleTests.test_no_docstringc	C�Dtdd�}|�|jd�|�|jd�|�|jdddddd��dS)Nr�foodocr'�rrrrrr$r
r
r�test_ascii_docstring>�
��z ModuleTests.test_ascii_docstringc	Cr-)Nr�	foodocሴr'r/r$r
r
r�test_unicode_docstringHr1z"ModuleTests.test_unicode_docstringc
Cs|tdd�}d|_|j}|�dd�|�|jd�|�|jd�|�|jd�|�|jddddddd��|�|j|u�dS)Nrr2�*r.)rr�barr(r)r*)rr5r�__init__rrrr)rr�dr
r
r�test_reinitRs
��zModuleTests.test_reinitcCs&dd�}t�|�|�jdd�dS)NcSstd�}d|_|S)Nr�)rr5)rr
r
r�fbsz+ModuleTests.test_dont_clear_dict.<locals>.fr5r9)rrr)rr:r
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_cycleis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_weakrefcCs�ddlm}ddlm}|�|d�|�|jd�|�|jd�|�td��|jWd�n1s4wY|�|j	d�t
jd=dS)	Nr)�testz
There is testr<�z Deprecated, use whatever insteadzThere is whatever�test.good_getattr)�test.good_getattr�good_getattrrEr�x�yr"rZyoloZwhatever�sys�modules)r�ggarEr
r
r�test_module_getattr�s��zModuleTests.test_module_getattrcCs�ddlm}ddlm}|�|jd�|�|jd�|�t��|jWd�n1s-wY|�t��|jWd�n1sEwYt	j
d=dt	j
vrYt	j
d=dSdS)Nr��bad_getattr2r<�test.bad_getattr�test.bad_getattr2)�test.bad_getattr�bad_getattrrErQrrJrrZnoperLrM�rZbgarQr
r
r�test_module_getattr_errors�s��
�z&ModuleTests.test_module_getattr_errorscCs,ddlm}|�t|�gd��tjd=dS)Nr)�a�b�crG)rHrIrrrLrM)rrNr
r
r�test_module_dir�szModuleTests.test_module_dircCs�ddlm}ddlm}|�t��t|�Wd�n1s wY|�t��t|�Wd�n1s9wYtjd=dtjvrMtjd=dSdS)NrrPrRrS)	rTrUrErQrrrrLrMrVr
r
r�test_module_dir_errors�s
�
�
�z"ModuleTests.test_module_dir_errorscCs�ddlm}|�t��|jWd�n1swY|�t��|jWd�n1s1wYdtjvrAtjd=dSdS)Nr)�bad_getattr3ztest.bad_getattr3)rEr]rrZoneZ
delgetattrrLrM)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)Nrrdz<module '?' from '/tmp/foo.py'>)rrrerrr_r
r
r�#test_module_repr_with_filename_only�sz/ModuleTests.test_module_repr_with_filename_onlycCs*td�}|jdusJ�|�t|�d�dSra)rr(rrr_r
r
r�$test_module_repr_with_loader_as_None�sz0ModuleTests.test_module_repr_with_loader_as_NonecC�4td�}|`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_namecCrirj)rrrr(rrrrkr
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_loadercC�(td�}t|_d|_|�t|�d�dSrc)rrr(rerrr_r
r
r�.test_module_repr_with_bare_loader_and_filename��z:ModuleTests.test_module_repr_with_bare_loader_and_filenamecCrq)Nrrdro)rrr(rerrr_r
r
r�.test_module_repr_with_full_loader_and_filename�rsz:ModuleTests.test_module_repr_with_full_loader_and_filenamecCs|�tt�d�dS)Nz<module 'sys' (built-in)>)rrrL)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_sourcecCs:tdd�\}}}|�|�|��}|�t|�hd��dS)Nz-czfrom test import final_a>sx = bs	len = lensx = as
final_b.x = bs
final_a.x = asshutil.rmtree = rmtree)r�assertFalse�
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�)N)�RuntimeError)r�o�tr
r
r�__get__szCModuleTests.test_descriptor_errors_propagate.<locals>.Descr.__get__N)rr
rr�r
r
r
r�Descrsr�cseZdZ��ZdS)z7ModuleTests.test_descriptor_errors_propagate.<locals>.MN)rr
r�melonr
�r�r
r�Ms
r�Zmymodr�)rrr�r#)rr�r
r�r� test_descriptor_errors_propagatesz,ModuleTests.test_descriptor_errors_propagatecCsvtd�}td�D]0}|�d|jv�|j}|�d|jv�|�|j|�|�|jd|�|dr4|`q|jd=qdS)Nrr9�__annotations__rF)r�rangerzrr�rr�rr�ir7r
r
r�test_lazy_create_annotations"s
�z(ModuleTests.test_lazy_create_annotationscCs~td�}td�D]4}|�d|jv�dti}||_|�d|jv�|�|j|�|�|jd|�|dr8|`q|jd=qdS)Nrr9r�rXrF)rr�rzr�intr�rrr�r
r
r�test_setting_annotations2s
�z$ModuleTests.test_setting_annotationscCs�t�t�}|�t��
t|j�Wd�n1swY|�t��i|_Wd�n1s2wY|�t��
|`Wd�n1sIwYtd�}i|_|`|�t��|`Wd�dS1sjwYdSr@)rrrr�printr�rr$r
r
r�test_annotations_getset_raises@s 
���"�z*ModuleTests.test_annotations_getset_raisescCs2t�d�}|�d|jv�|`|�d|jv�dS)Nztest.ann_module4r�)rZimport_fresh_modulerrr�rz)rZann_module4r
r
r�&test_annotations_are_created_correctlyQs
z2ModuleTests.test_annotations_are_created_correctlyN)%rr
rr r%r&r,r0r3r8r;r?rDrOrWr[r\r^r`rbrfrgrhrlrmrnrprrrtruryr�r�r�r�r�r�r
r
r
rrsF


	

		
r�__main__)rvrAZtest.supportrrZtest.support.script_helperrrL�typerrrZTestCaserr�mainr
r
r
r�<module>sI�
© 2025 GrazzMean