
    ;eg                     4   d dl Z d dlmZ d dlmZ d dlZd dlZd dlZ	 d dlZn# e	$ r dZY nw xY w ej
        dd          r e j        d           G d de          Z G d	 d
e          Z G d de j                  Zedk    r e j                     dS dS )    N)support)warnings_helperT)addressmemoryz>workaround ASAN build issues on loading tests like tk or cryptc                       e Zd ZdS )NoAllN__name__
__module____qualname__     (/usr/lib/python3.11/test/test___all__.pyr   r              Dr   r   c                       e Zd ZdS )FailedImportNr	   r   r   r   r   r      r   r   r   c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )AllTestc                 Z    t           #t          j        d          t          j        d<   d S d S N_multiprocessing)r   types
ModuleTypesysmodulesselfs    r   setUpzAllTest.setUp   s1     #.3.>?Q.R.RCK*+++ $#r   c                 V    t           !t          j                            d           d S d S r   )r   r   r   popr   s    r   tearDownzAllTest.tearDown%   s+    #KOO.///// $#r   c           
      4   i }t          j        d| t          fdt          fdt          fdt          fd          5  	 t          d|z  |           n#  t          |          xY w	 d d d            n# 1 swxY w Y   t          t          j	        |         d          st          |          i }|                     |          5  t          j        dt          fdt          fd          5  	 t          d	|z  |           nK# t          $ r>}|                     d
                    ||j        j        |                     Y d }~nd }~ww xY wd|v r|d= d|v r|d= d|v r|d= t#          |          }t          j	        |         j        }t#          |          }|                     ||d                    |                     |                     ||d                    |                     d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nz.*z.* (module|package) T)quietz	import %s__all__)modulezfrom %s import *z__all__ failure in {}: {}: {}__builtins____annotations____warningregistry__zin module {})r   check_warningsDeprecationWarningPendingDeprecationWarningResourceWarningexecr   hasattrr   r   r   subTest	Exceptionfailformat	__class__r
   setr%   assertCountEqualassertEqual)r   modnamenamesekeysall_listall_sets          r   	check_allzAllTest.check_all)   sm   +'^^/0"$67"$=>!   	, 	,,[7*E2222, #7+++ 3	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, s{7+Y77 	!.. \\\)) 	P 	P /'(_%   P PA+g5u====  A A AII=DD%q{';Q@ @ A A A A A A A AA "U**n-$--/0(E11345zz;w/7h--%%gx9N9Nw9W9WXXX  w0E0Eg0N0NOOO)P P P P P P P P P P P P P P P	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	Ps   A2AA2A""A22A69A6&H*G5,D ?G5 
E
4E>G5EB!G5)H5G9	9H<G9	=HHHc              #     K   t          t          j        |                    D ]}t          j                            ||          }t          j                            |          rqt          j                            |d          }t          j                            |          r1|||z   fV  |                     |||z   dz             D ]\  }}||fV  |                    d          r|dk    r|||d d         z   fV  d S )Nz__init__.py.z.py)	sortedoslistdirpathjoinisdirexistswalk_modulesendswith)r   basedirmodpathfnrE   pkg_initpms           r   rI   zAllTest.walk_modulesR   s     G,,-- 	* 	*B7<<,,Dw}}T"" 7<<m<<7>>(++ #"GbL0000 $ 1 1$"s8J K K # #1d



;;u%% })<)<"SbS'))))))	* 	*r   c                 j   t          dg          }t          j                            d          sdd l}g }g }t
          j                            t
          j                            t                              }| 	                    |d          D ]\  }}|}d}	|r$||v rd}	n|
                    d          d         }|$|	r2t          j        rt          |           	 t          |d          5 }
d	|
                                vrt!          |          |                     |           d d d            n# 1 swxY w Y   # t           $ r |                    |           Y t&          $ r |                    |           Y w xY wt          j        r"t          d
|           t          d|           d S d S )N
__future__javar   r#   FTr@   rbs   __all__z8Following modules have no __all__ and have been ignored:z(Following modules failed to be imported:)r5   r   platform
startswith_socketrC   rE   dirname__file__rI   
rpartitionr   verboseprintopenreadr   r>   appendr   )r   denylistrW   ignoredfailed_importslib_dirrE   r8   rP   deniedfs              r   test_allzAllTest.test_all`   s5   
  
 |&&v.. 	 NNN'//"'//(";";<<!..w;; 	/ 	/MD'AF )==!FLL%%a(	  )
   g
/ $%% ,!11#Gnn,NN7+++, , , , , , , , , , , , , , ,  ( ( (w''''' / / /%%g...../ ? 	NL  <nMMMMM	N 	Ns<   E -;D4(E 4D8	8E ;D8	<E  F!FFN)r
   r   r   r   r!   r>   rI   rf   r   r   r   r   r      sk        S S S0 0 0'P 'P 'PR* * **N *N *N *N *Nr   r   __main__)unittesttestr   test.supportr   rC   r   r   r   ModuleNotFoundErrorcheck_sanitizerSkipTestRuntimeErrorr   r   TestCaser   r
   mainr   r   r   <module>rq      sz          ( ( ( ( ( ( 				 



     74555 0 (
 / 0 0 0	 	 	 	 	L 	 	 		 	 	 	 	< 	 	 	nN nN nN nN nNh nN nN nNb zHMOOOOO s   # --