HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/test/test_importlib/builtin/__pycache__/test_loader.cpython-38.pyc
U

/D�g��@s�ddlmZddlmZe�d�ZddlZddlZddlZe�ej	j
dkd�Gdd�dej��Zejeed	�\Z
Ze�ej	j
dkd�Gd
d�d��Zejeed	�\ZZedkr�e��dS)
�)�abc)�utilzimportlib.machinery�Nzno reasonable builtin modulec@sTeZdZdZdd�Zdd�Zdd�Zdd	�Zd
ZZ	d
Z
dd�Zd
d�Zdd�Z
d
S)�LoaderTestsz(Test load_module() for built-in modules.cCsdd|jjd�|_dS)N�errno�)�__name__�__package__�
__loader__)�	machinery�BuiltinImporter�verification)�self�r�F/opt/cppython/lib/python3.8/test/test_importlib/builtin/test_loader.py�setUps�zLoaderTests.setUpcCsH|�|tj�|j��D]\}}|�t||�|�q|�|jt	j
�dS)z;Verify that the module matches against what it should have.N)ZassertIsInstance�types�
ModuleTyper
�items�assertEqual�getattrZassertInr�sys�modules)r�module�attr�valuerrr�verifyszLoaderTests.verifycCs|jj�|�S�N)rr�load_module)r�namerrrrszLoaderTests.load_modulec	Cs6t�tjj��|�tjj�}|�|�W5QRXdSr)r�uncache�BUILTINS�	good_namerr)rrrrr�test_moduleszLoaderTests.test_moduleNc	CsFt�tjj��.|�tjj�}|�tjj�}|�||�W5QRXdSr)rr r!r"rZassertIs)rZmodule1Zmodule2rrr�test_module_reuse)szLoaderTests.test_module_reusec	CsFd}|tjkst�|�t��}|�|�W5QRX|�|jj|�dS)NZ	dssdsdfff)	r�builtin_module_names�AssertionError�assertRaises�ImportErrorrr�	exceptionr)rr�cmrrr�test_unloadable0s
zLoaderTests.test_unloadablec	Cspd}|tjkst�t�|��t�|�}|tj|<W5QRX|�t	��}|�
|�W5QRX|�|jj
|�dS)NZbuiltin_reload_test)rr%r&rr rrrr'r(rrr)r)r�module_namerr*rrr�test_already_imported7s
z!LoaderTests.test_already_imported)r�
__module__�__qualname__�__doc__rrrr#Ztest_packageZtest_lacking_parentZtest_state_after_failurer$r+r-rrrrr
sr)rc@sDeZdZdZdd�Zdd�Zdd�Ze�e	j
jdkd	�d
d��ZdS)�InspectLoaderTestsz4Tests for InspectLoader methods for BuiltinImporter.cCs |jj�tjj�}|�|�dSr)rr�get_coderr!r"�assertIsNone�r�resultrrr�
test_get_codeNsz InspectLoaderTests.test_get_codecCs |jj�tjj�}|�|�dSr)rr�
get_sourcerr!r"r3r4rrr�test_get_sourceSsz"InspectLoaderTests.test_get_sourcecCs |jj�tjj�}|�|�dSr)rr�
is_packagerr!r"ZassertFalser4rrr�test_is_packageXsz"InspectLoaderTests.test_is_packageNzall modules are built inc	Cs>dD]}t|jj|�}q|�t��}|tjj�W5QRXdS)N)r2r7r9)rrrr'r(rr!�bad_name)rZ	meth_name�methodr*rrr�test_not_builtin]sz#InspectLoaderTests.test_not_builtin)
rr.r/r0r6r8r:�unittest�skipIfrr!r;r=rrrrr1Isr1�__main__)rrrZimport_importlibrrrr>r?r!r"rZ	test_bothZFrozen_LoaderTestsZSource_LoaderTestsr1ZFrozen_InspectLoaderTestsZSource_InspectLoaderTestsr�mainrrrr�<module>s"
;��