Your IP : 216.73.216.85


Current Path : /opt/alt/python39/lib64/python3.9/test/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/__pycache__/test___all__.cpython-39.pyc

a

XC?h��@s�ddlZddlmZddlZddlZejddd�r<e�d��Gdd�de�ZGdd	�d	e�Z	Gd
d�dej
�Zedkr~e�
�dS)
�N)�supportT)ZaddressZmemoryz>workaround ASAN build issues on loading tests like tk or cryptc@seZdZdS)�NoAllN��__name__�
__module__�__qualname__�rr�6/opt/alt/python39/lib64/python3.9/test/test___all__.pyrsrc@seZdZdS)�FailedImportNrrrrr	r
sr
c@s$eZdZdd�Zdd�Zdd�ZdS)�AllTestcCs�i}tjdtfdtfdtfdd��8ztd||�Wnt|��Yn0Wd�n1s`0Yttj	|d�s�t
|��i}|j|d���tjdtfdtfdd���ztd||�Wn<ty�}z$|�
d	�||jj|��WYd}~n
d}~00d
|v�r|d
=d|v�r |d=d|v�r0|d=t|�}tj	|j}t|�}|�||d
�|��|�||d
�|��Wd�n1�s�0YWd�n1�s�0YdS)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_setrrr	�	check_allsJ�,�
�


zAllTest.check_allccs�tt�|��D]�}tj�||�}tj�|�r~tj�|d�}tj�|�r|||fV|�|||d�D]\}}||fVqhq|�d�r|dkr�q|||dd�fVqdS)Nz__init__.py�.z.py���)	�sorted�os�listdir�path�join�isdir�exists�walk_modules�endswith)rZbasedir�modpath�fnr(Zpkg_init�p�mrrr	r,?szAllTest.walk_modulesc	Cs4tdg�}tj�d�sddl}g}g}tj�tj�t��}|�	|d�D]�\}}|}d}	|rx||vrhd}	qx|�
d�d}qV|	r~qFtjr�t
|�zLt|d��.}
d	|
��vr�t|��|�|�Wd�n1s�0YWqFty�|�|�YqFt�y|�|�YqF0qFtj�r0t
d
|�t
d|�dS)NZ
__future__�javarrFTr#�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
)rZ	blacklistr6ZignoredZfailed_importsZlib_dirr(rr1Zblacklisted�frrr	�test_allMsD�,�zAllTest.test_allN)rrrr"r,r@rrrr	rs(r�__main__)Zunittest�testrr&rZcheck_sanitizerZSkipTest�RuntimeErrorrr
ZTestCaserr�mainrrrr	�<module>s
e