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_module.cpython-37.opt-1.pyc
B

��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
�,/usr/local/lib/python3.7/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|�y|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#)rrr
r
r�test_missing_getattr)sz ModuleTests.test_missing_getattrc	Csltd�}|�|jd�|�|jd�|�|jd�|�|jd�|�|jd�|�|jdddddd��dS)Nr)rr�
__loader__�__package__�__spec__)	rrrr�assertIsr&r'r(r)rrr
r
r�test_no_docstring1szModuleTests.test_no_docstringc	CsDtdd�}|�|jd�|�|jd�|�|jdddddd��dS)Nr�foodoc)rrr&r'r()rrrrr)rrr
r
r�test_ascii_docstring=s
z ModuleTests.test_ascii_docstringc	CsDtdd�}|�|jd�|�|jd�|�|jdddddd��dS)Nru	foodocሴ)rrr&r'r()rrrrr)rrr
r
r�test_unicode_docstringGs
z"ModuleTests.test_unicode_docstringc
Cs|tdd�}d|_|j}|�dd�|�|jd�|�|jd�|�|jd�|�|jddddddd��|�|j|k�dS)Nru	foodocሴ�*r+)rr�barr&r'r()rr/r�__init__rrrr)rr�dr
r
r�test_reinitQs
zModuleTests.test_reinitcCs&dd�}t�|�|�jdd�dS)NcSstd�}d|_|S)Nr�)rr/)rr
r
r�fasz+ModuleTests.test_dont_clear_dict.<locals>.fr/r3)rrr)rr4r
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)rr7r	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	Zwrr
r
r�test_weakrefxs
zModuleTests.test_weakrefc	Csxddlm}ddlm}|�|d�|�|jd�|�|jd�|�td��|jWdQRX|�|j	d�t
jd=dS)	Nr)�testz
There is testr6�z Deprecated, use whatever insteadzThere is whateverztest.good_getattr)�test.good_getattr�good_getattrr=r�x�yr"rZyoloZwhatever�sys�modules)r�ggar=r
r
r�test_module_getattr�szModuleTests.test_module_getattrc	Cs�ddlm}ddlm}|�|jd�|�|jd�|�t��|jWdQRX|�t��|jWdQRXt	j
d=dt	j
kr�t	j
d=dS)Nr)�bad_getattr2r6ztest.bad_getattrztest.bad_getattr2)�test.bad_getattr�bad_getattrr=rGrrAr�	TypeErrorZnoperCrD)r�bgarGr
r
r�test_module_getattr_errors�s
z&ModuleTests.test_module_getattr_errorscCs.ddlm}|�t|�dddg�tjd=dS)Nr�a�b�cztest.good_getattr)r?r@rrrCrD)rrEr
r
r�test_module_dir�szModuleTests.test_module_dirc	Csrddlm}ddlm}|�t��t|�WdQRX|�t��t|�WdQRXtjd=dtjkrntjd=dS)Nr)rGztest.bad_getattrztest.bad_getattr2)	rHrIr=rGrrJrrCrD)rrKrGr
r
r�test_module_dir_errors�s
z"ModuleTests.test_module_dir_errorsc	CsZddlm}|�t��|jWdQRX|�t��|jWdQRXdtjkrVtjd=dS)Nr)�bad_getattr3ztest.bad_getattr3)r=rRrrZoneZ
delgetattrrCrD)rrRr
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'>)rrr)rr	r
r
r�test_module_repr_with_name�sz&ModuleTests.test_module_repr_with_namecCs"td�}d|_|�t|�d�dS)Nrz/tmp/foo.pyz!<module 'foo' from '/tmp/foo.py'>)r�__file__rr)rr	r
r
r�'test_module_repr_with_name_and_filename�sz3ModuleTests.test_module_repr_with_name_and_filenamecCs&td�}|`d|_|�t|�d�dS)Nrz/tmp/foo.pyz<module '?' from '/tmp/foo.py'>)rrrVrr)rr	r
r
r�#test_module_repr_with_filename_only�sz/ModuleTests.test_module_repr_with_filename_onlycCstd�}|�t|�d�dS)Nrz<module 'foo'>)rrr)rr	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	�loader_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�|��dS)Nrz<module '?' ({})>)rrrr&rrr)rr	rZr
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)Nrz<module 'foo' (crafted)>)rrr&rr)rr	r
r
r�!test_module_repr_with_full_loader�sz-ModuleTests.test_module_repr_with_full_loadercCs(td�}t|_d|_|�t|�d�dS)Nrz/tmp/foo.pyz!<module 'foo' from '/tmp/foo.py'>)rrr&rVrr)rr	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)Nrz/tmp/foo.pyz<module 'foo' (crafted)>)rrr&rVrr)rr	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)>)rrrC)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_sourcesz#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)rZrc�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
rror
r
r
r�DescrsrpcseZdZ��ZdS)z7ModuleTests.test_descriptor_errors_propagate.<locals>.MN)rr
r�melonr
)rpr
r�MsrrZmymodrq)rrrlr#)rrrr
)rpr� test_descriptor_errors_propagatesz,ModuleTests.test_descriptor_errors_propagateN)"rr
rr r$r%r*r,r-r2r5rr9r<rFrLrPrQrSrTrUrWrXrYr[r\r]r^r_r`rarerkrsr
r
r
rrs<


	

		r�__main__)rbr:Ztest.supportrrZtest.support.script_helperrrC�typerrrZTestCaserr�mainr
r
r
r�<module>s