Your IP : 216.73.216.196


Current Path : /opt/alt/python310/lib64/python3.10/test/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/test/__pycache__/test___all__.cpython-310.opt-2.pyc

o

0�iU�@s�ddlZddlmZddlmZddlZddlZejddd�r$e�d��Gdd�de	�Z
Gd	d
�d
e	�ZGdd�dej�Z
ed
krGe��dSdS)�N)�support)�warnings_helperT)ZaddressZmemoryz>workaround ASAN build issues on loading tests like tk or cryptc@�eZdZdS)�NoAllN��__name__�
__module__�__qualname__�r
r
�8/opt/alt/python310/lib64/python3.10/test/test___all__.pyr�rc@r)�FailedImportNrr
r
r
rr
rr
c@s$eZdZdd�Zdd�Zdd�ZdS)�AllTestcCs�i}tjdtfdtfdtfdd��z	td||�Wnt|��Wd�n1s-wYttj	|d�s>t
|��i}|j|d���tjdtfdtfdd��gz	td||�Wnty{}z|�
d	�||jj|��WYd}~nd}~wwd
|vr�|d
=d|vr�|d=d|vr�|d=t|�}tj	|j}t|�}|�||d
�|��|�||d
�|��Wd�n1s�wYWd�dSWd�dS1s�wYdS)Nz.* (module|package)�T)�quietz	import %s�__all__)�modulezfrom %s import *z__all__ failure in {}: {}: {}�__builtins__�__annotations__Z__warningregistry__zin module {})rZcheck_warnings�DeprecationWarning�PendingDeprecationWarning�ResourceWarning�execr
�hasattr�sys�modulesrZsubTest�	ExceptionZfail�format�	__class__r�setrZassertCountEqualZassertEqual)�self�modname�names�e�keysZall_listZall_setr
r
r�	check_allsZ����
�����"�zAllTest.check_allccs��|dkrdStt�|��D]M}tj�||�}tj�|�rFtj�|d�}tj�|�rE|||fV|�|||d�D]	\}}||fVq;q|�d�rO|dkrPq|||dd�fVqdS)Nz
distutils.z__init__.py�.z.py���)	�sorted�os�listdir�path�join�isdir�exists�walk_modules�endswith)r Zbasedir�modpath�fnr+Zpkg_init�p�mr
r
rr/@s ��zAllTest.walk_modulesc	Cs4tdg�}tj�d�sddl}g}g}tj�tj�t��}|�	|d�D]e\}}|}d}	|r=||vr4d}	n	|�
d�d}|s-|	r@q#tjrGt
|�z&t|d��}
d	|
��vrXt|��|�|�Wd�n1sgwYWq#ty{|�|�Yq#ty�|�|�Yq#wtjr�t
d
|�t
d|�dSdS)NZ
__future__�javarrFTr&�rbs__all__z8Following modules have no __all__ and have been ignored:z(Following modules failed to be imported:)rr�platform�
startswith�_socketr)r+�dirname�__file__r/�
rpartitionr�verbose�print�open�readrr%�appendr
)r Zdenylistr9ZignoredZfailed_importsZlib_dirr+r!r4Zdenied�fr
r
r�test_allTsN�������zAllTest.test_allN)rrr	r%r/rCr
r
r
rrs(r�__main__)Zunittest�testrZtest.supportrr)rZcheck_sanitizerZSkipTest�RuntimeErrorrr
ZTestCaserr�mainr
r
r
r�<module>s
k�