+
    BicA                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RI	t	^ RI
t
^ RIt^ RIHtHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHtHt ^ RIHt ^ RIHt ^ RIt^ RIH t  ]PB                  ! R4      t"]"PG                  ]"4       ]PB                  ! RRR.R7      t$]$PG                  ]$4       ]R 4       t% ! R R]&4      t' ! R R4      t( ! R R](4      t) ! R R])]PT                  4      t+ ! R R])]PT                  4      t, ! R R](4      t- ! R R ]-]PT                  4      t. ! R! R"]-]PT                  4      t/ ! R# R$](4      t0 ! R% R&]0]PT                  4      t1 ! R' R(]0]PT                  4      t2 ! R) R*](4      t3 ! R+ R,]3]PT                  4      t4 ! R- R.]3]PT                  4      t5 ! R/ R0](]PT                  4      t6 ! R1 R2](4      t7 ! R3 R4]7]PT                  4      t8 ! R5 R6]7]PT                  4      t9 ! R7 R8](4      t: ! R9 R:]:]PT                  4      t; ! R; R<]:]PT                  4      t< ! R= R>](4      t= ! R? R@]=]PT                  4      t> ! RA RB]=]PT                  4      t? ! RC RD]PT                  4      t@ ! RE RF](]PT                  4      tA ! RG RH]PT                  4      tB ! RI RJ]PT                  4      tC ! RK RL](4      tD ! RM RN]D]PT                  4      tE ! RO RP]D]PT                  4      tF ! RQ RR](4      tG ! RS RT]G]PT                  4      tH ! RU RV]G]PT                  4      tI ! RW RX],4      tJRY tK]KtL]MRZ8X  d   ]P                  ! 4        R# R# )[    )contextmanagerN)StringIO)overloadget_overloads)support)import_helper)	os_helper)warnings_helper)force_not_colorized)assert_python_okassert_python_failure)package_helper
stacklevel)
deprecated_py_warningswarnings	_warnings)freshc              #     "   \         \        3 F  p VP                  P                  4        K   	   \        P                  4        \        P                  pV P                  '       d   V P                  4       w  r4MV P                  pVR ,          V n	         V P                  R4       V \        n        Rx  V\        n        V P                  '       d   V P                  X4       R# XV n	        R#   \         d     K  i ; i  \
         d     Li ; i  T\        n        T P                  '       d   T P                  X4       i XT n	        i ; i5i)NNNonceN)syswarning_tests__warningregistry__clearAttributeError	NameErrorr   _use_context_new_contextfilterssimplefilter_set_context)moduleto_clearoriginal_warningssaved_contextcontextoriginal_filterss   &     2/usr/lib/python3.14/test/test_warnings/__init__.pywarnings_stater+   #   s     -(	((..0 )
!!# &..!'!4!4!6w!>>)!,	.F#!'!2.-FN+  		   "3.-FNsh   EC/ED !E(-E D 69E/C>:E=C>>EDEDE8E

Ec                       ] tR t^BtRtR# )TestWarning N__name__
__module____qualname____firstlineno____static_attributes__r.       r*   r-   r-   B   s    r5   r-   c                   >   a a ] tR t^Ft oV 3R ltV 3R ltRtVtV ;t# )BaseTestc                  < \         P                  P                  V n        R \	        4       9   d   \	        4       R  \        \        R 4      '       d   \        =\        \        R 4      '       d   \        =V P                  \        P                  R&   V P                  \         P                  n        \        \        V `7  4        R# )r   r   N)unittestcaser   old_unittest_moduleglobalshasattrr   r   r   r$   modulessuperr7   setUpself	__class__s   &r*   r@   BaseTest.setUpJ   s    #+==#9#9  !GI-	/0="78813-..' #'++J "&h#%r5   c                   < \         \        P                  R &   V P                  \        P
                  n        \        \        V `'  4        R# )r   N)
r&   r   r>   r;   r9   r:   r   r?   r7   tearDownrA   s   &r*   rF   BaseTest.tearDown]   s0    "3J!%!9!9h&(r5   )r;   )	r0   r1   r2   r3   r@   rF   r4   __classdictcell____classcell__rC   __classdict__s   @@r*   r7   r7   F   s     &&) )r5   r7   c                   &   a  ] tR t^bt o R tRtV tR# )PublicAPITestsc                    V P                  V P                  R 4       . ROpV P                  \        V P                  P                  4      \        V4      4       R# )__all__N)	warnwarn_explicitshowwarningformatwarningfilterwarningsr"   resetwarningscatch_warningsr   )assertHasAttrr$   assertSetEqualsetrO   )rB   
target_apis   & r*   test_module_all_attribute(PublicAPITests.test_module_all_attributeh   sF    4;;	2G
 	C 3 34
O	-r5   r.   N)r0   r1   r2   r3   r[   r4   rH   rK   s   @r*   rM   rM   b   s     - -r5   rM   c                       ] tR t^pt]tRtR# )CPublicAPITestsr.   Nr0   r1   r2   r3   
c_warningsr$   r4   r.   r5   r*   r_   r_   p       Fr5   r_   c                       ] tR t^st]tRtR# )PyPublicAPITestsr.   Nr0   r1   r2   r3   py_warningsr$   r4   r.   r5   r*   rd   rd   s       Fr5   rd   c                      a  ] tR t^vt o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )FilterTestsc                P   V P                   P                  4       ;_uu_ 4       pV P                   P                  4        V P                   P                  R \        R7       V P                  \        V P                   P                  R4       RRR4       R#   + '       g   i     R# ; i)errorcategoryzFilterTests.test_errorN)r$   rV   rU   rT   UserWarningassertRaisesrP   rB   ws   & r*   
test_errorFilterTests.test_errorz   sl    [[''))QKK%%'KK&&w&Ek4;;+;+; 8: *)))s   A'BB%	c           	     $  a a S P                   P                  4       ;_uu_ 4       pS P                   P                  4        R oVV 3R lp\        P                  ! 4       ;_uu_ 4       pV! 4        RRR4       XP                  4       pS P                  RV4       S P                  RV4       S P                   P                  R\        R7       S P                  \        V4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)%FilterTests.test_ignore_after_defaultc                  H   < SP                   P                  S \        4       R # Nr$   rP   rn   messagerB   s   r*   f/FilterTests.test_error_after_default.<locals>.f         +6r5   Nz2UserWarning: FilterTests.test_ignore_after_defaultz&self.module.warn(message, UserWarning)rk   rl   )
r$   rV   rU   r   captured_stderrgetvalueassertInrT   rn   ro   )rB   rq   r{   stderrrz   s   f   @r*   test_error_after_default$FilterTests.test_error_after_default   s    [[''))QKK%%'=G7 ((**f +__&FMMN "MMB " KK&&w&Ek1- *) +* *))s%   AC>&C+	.A3C>+C;6C>>D	c                   V P                   P                  R R7      ;_uu_ 4       pV P                   P                  4        V P                   P                  R\        R7       V P                   P                  R\        4       V P                  \        V4      ^ 4       V P                  \        \        4      R.4       RRR4       R#   + '       g   i     R# ; i)Trecordignorerl   zFilterTests.test_ignoreversionN)
r$   rV   rU   rT   rn   rP   assertEquallenlistr   rp   s   & r*   test_ignoreFilterTests.test_ignore   s    [[''t'44KK%%'KK&&x+&FKK6DSVQ'T"56D 5444s   BCC	c                t  a a S P                   P                  R R7      ;_uu_ 4       pS P                   P                  4        RoVV 3R lpV! 4        S P                   P                  R\        R7       V! 4        V! 4        S P                  \        V4      ^4       RRR4       R#   + '       g   i     R# ; i)Tr   ru   c                  H   < SP                   P                  S \        4       R # rw   rx   ry   s   r*   r{   0FilterTests.test_ignore_after_default.<locals>.f   r}   r5   r   rl   N)r$   rV   rU   rT   rn   r   r   )rB   rq   r{   rz   s   f  @r*   test_ignore_after_default%FilterTests.test_ignore_after_default   s    [[''t'44KK%%'=G7CKK&&x+&FCCSVQ' 5444s   A5B&&B7	c                  a a R EF!  pS P                   P                  RR7      ;_uu_ 4       pS P                   P                  4        S P                   P                  V\        R7       RoVV 3R lpV! 4        S P                  \        V4      ^4       S P                  VR,          P                  P                  ^ ,          S4       V! 4        S P                  \        V4      ^4       S P                  VR,          P                  P                  ^ ,          S4       RRR4       EK$  	  R#   + '       g   i     EK:  ; i)	alwaysTr   rl   zFilterTests.test_always_and_allc                  H   < SP                   P                  S \        4       R # rw   rx   ry   s   r*   r{   *FilterTests.test_always_and_all.<locals>.f       KK$$Wk:r5   N>   allr   )	r$   rV   rU   rT   rn   r   r   rz   argsrB   moderq   r{   rz   s   f   @r*   test_always_and_allFilterTests.test_always_and_all   s    %D++4+88A))+**4+*F;;  Q+  2!3!3A!6@  Q+  2!3!3A!6@ 98 &888s   C1D--D?c                t  a a R EF  pS P                   P                  RR7      ;_uu_ 4       pS P                   P                  4        RoVV 3R lpV! 4        S P                  \	        V4      ^4       S P                  VR,          P
                  P                  ^ ,          S4       V! 4        S P                  \	        V4      ^4       S P                   P                  V\        R7       V! 4        S P                  \	        V4      ^4       S P                  VR,          P
                  P                  ^ ,          S4       V! 4        S P                  \	        V4      ^4       S P                  VR,          P
                  P                  ^ ,          S4       RRR4       EK  	  R#   + '       g   i     EK  ; i)	r   Tr   z,FilterTests.test_always_and_all_after_ignorec                  H   < SP                   P                  S \        4       R # rw   rx   ry   s   r*   r{   8FilterTests.test_always_and_all_after_default.<locals>.f   r   r5   rl   N>   r   r   r   )	r$   rV   rU   r   r   rz   r   rT   rn   r   s   f   @r*   !test_always_and_all_after_default-FilterTests.test_always_and_all_after_default   s7   %D++4+88A))+H;  Q+  2!3!3A!6@  Q+**4+*F  Q+  2!3!3A!6@  Q+  2!3!3A!6@! 98 &888s   E)F%%F7c                0   V P                   P                  R R7      ;_uu_ 4       pV P                   P                  4        V P                   P                  R\        R7       \	        R4      p\        ^4       F  pV P                   P                  V\        4       V^ 8X  d)   V P                  VR,          P                  V4       VR KR  V^8X  d   V P                  \        V4      ^ 4       Kv  \        R4      h	  RRR4       R#   + '       g   i     R# ; i)	Tr   defaultrl   zFilterTests.test_defaultr   zloop variant unhandledNr   )r$   rV   rU   rT   rn   rangerP   r   rz   r   
ValueError)rB   rq   rz   xs   &   r*   test_defaultFilterTests.test_default   s    [[''t'44KK%%'KK&&y;&G!"<=G1X  +66$$QrU]]G<!!V$$SVQ/$%=>> 	 5444s   CDD	c                   V P                   P                  R R7      ;_uu_ 4       pV P                   P                  4        V P                   P                  R\        R7       \	        R4      pV P                   P                  V\        4       V P                  VR,          P                  V4       VR V P                   P                  V\        4       V P                  \        V4      ^ 4       RRR4       R#   + '       g   i     R# ; i)Tr   r$   rl   zFilterTests.test_moduler   Nr   )	r$   rV   rU   rT   rn   rP   r   rz   r   rB   rq   rz   s   &  r*   test_moduleFilterTests.test_module   s    [[''t'44KK%%'KK&&x+&F!";<GKKWk2QrU]]G4!KKWk2SVQ' 5444s   CC77D	c                   V P                   P                  R R7      ;_uu_ 4       pV P                   P                  4        V P                   P                  R\        R7       \	        R4      pV P                   P                  V\        R^*4       V P                  VR	,          P                  V4       VR V P                   P                  V\        R^4       V P                  \        V4      ^ 4       V P                   P                  V\        R^*4       V P                  \        V4      ^ 4       RRR4       R#   + '       g   i     R# ; i)
Tr   r   rl   zFilterTests.test_once__init__.pyr   ztest_warnings2.pyNr   )	r$   rV   rU   rT   rn   rQ   r   rz   r   r   s   &  r*   	test_onceFilterTests.test_once   s    [[''t'44KK%%'KK&&v&D!"9:GKK%%g{M$&(QrU]]G4!KK%%g{M$&(SVQ'KK%%g{<O$&(SVQ' 5444s   D	D88E		c                   V P                   P                  R R7      ;_uu_ 4       pV P                   P                  R\        4       V P                   P	                  R\        R^*RR7       V P                  \        V4      ^4       V P                  \        4      ;_uu_ 4        V P                   P	                  R\        R^*R R7       RRR4       V P                  \        V4      ^4       V P                   P	                  R\        R^*/ R7       V P                  \        V4      ^4       RRR4       R#   + '       g   i     Lt; i  + '       g   i     R# ; i)Tr   r   msgfilenameNmodule_globals)	r$   rV   r"   rn   rQ   r   r   ro   	TypeErrorrp   s   & r*   test_module_globalsFilterTests.test_module_globals   s   [[''t'44KK$$X{; KK%%e[*b59 & ;SVQ' ""9--))%j"9= * ? . SVQ' KK%%e[*b57 & 9SVQ'# 54 .- 544s%   A=E"%D3	A"E3E>EE	c                Z   V P                   P                  4       ;_uu_ 4       pV P                   P                  4        V P                   P                  R \        R7       V P                  \        V P                   P                  R\        4       RRR4       R#   + '       g   i     R# ; i)rk   rl   zFilterTests.test_inheritanceN)r$   rV   rU   rT   Warningro   rn   rP   rp   s   & r*   test_inheritanceFilterTests.test_inheritance  so    [[''))QKK%%'KK&&w&Ak4;;+;+; >M *)))s   A,BB*	c                   V P                   P                  R R7      ;_uu_ 4       pV P                   P                  4        V P                   P                  R\        R7       V P                   P                  R\        R R7       VR  V P                   P                  R\        4       V P                  \        V4      ^ 4       R	R	R	4       R	#   \         d    T P                  R4        LCi ; i  + '       g   i     R	# ; i)
Tr   r   rl   rk   )rm   appendr   zFilterTests.test_orderingz!order handling for actions failedN)	r$   rV   rU   rT   rn   rP   failr   r   rp   s   & r*   test_orderingFilterTests.test_ordering  s    [[''t'44KK%%'KK&&x+&FKK&&w/3 ' 5!?  !<kJ SVQ' 54  ?		=>? 544s0   A!C. C'C.C+(C.*C++C..C?	c           	        V P                   P                  R R7      ;_uu_ 4       pV P                   P                  RR\        R^ 4       V P	                  \
        V P                   P                  R4       V P                   P                  4        RpV P                   P                  V4       V P                  \        VR,          P                  4      V4       V P                  VR,          P                  \
        4       V P                   P                  RR\        R^ 4       RpV P                   P                  V4       V P                  \        VR,          P                  4      V4       V P                   P                  4        V P                   P                  RR\        R^ 4       V P	                  \
        V P                   P                  R	4       R
pV P                   P                  V4       V P                  \        VR,          P                  4      V4       V P                  VR,          P                  \
        4       RRR4       R#   + '       g   i     R# ; i)Tr   rk    convert to errorzhandle normallyr   zfiltered outzhex*zhex/octznonmatching textNr   )r$   rV   rT   r   ro   rn   rP   rU   r   strrz   assertIsrm   assertNotEqual)rB   rq   texts   &  r*   test_filterwarningsFilterTests.test_filterwarnings  s    [[''t'44KK&&wGRCk4;;+;+;=OPKK%%'$DKKT"S2/6MM!B%..+6KK&&xWb!D!DKKT"AbEMM 2D9KK%%'KK&&wQGk4;;+;+;YG%DKKT"S2/6MM!B%..+6+ 5444s   HII	c                j   V P                   P                  R R7      ;_uu_ 4       pV P                   P                  R\        4       V P                   P	                  RR\        4       V P                  \        V P                   P                  R4       V P                  \        V P                   P                  R4       V P                   P                  R4       V P                  V. 4       V P                   P                  R4       V P                  V. 4       RRR4       R#   + '       g   i     R# ; i)	Tr   r   rk   matchzmatch prefixzsuffix matchzsomething completely differentN)r$   rV   r"   rn   rT   ro   rP   r   rp   s   & r*   test_message_matching!FilterTests.test_message_matching6  s    [[''t'44KK$$X{;KK&&wEk4;;+;+;WEk4;;+;+;^LKK^,Q#KK=>Q# 5444s   C2D!!D2	c                  a  ! V3R  lR4      p\        ^4       Uu. uF  pRV! 4       \        V! 4       ^ 3NK  	  upoV P                  P                  RR7      ;_uu_ 4       pSV P                  n        V P                  P                  \        R4      RR^*4       V P                  \        VR,          P                  4      R4       RRR4       R# u upi   + '       g   i     R# ; i)	c                   .   <a  ] tR tRt o V3R ltRtV tR# ).FilterTests.test_mutate_filter_list.<locals>.XiB  c                   < . SR &   R# )r   Nr.   )rB   aLs   &&r*   r   4FilterTests.test_mutate_filter_list.<locals>.X.matchC  s    !r5   r.   N)r0   r1   r2   r3   r   r4   rH   )rK   r   s   @r*   Xr   B  s      r5   r   r   Tr   bNzf.pyr   )	r   rn   r$   rV   r!   rQ   r   r   rz   )rB   r   irq   r   s   &   @r*   test_mutate_filter_list#FilterTests.test_mutate_filter_listA  s    	 	 9>aA1iKA.A[[''t'44"#DKKKK%%k#&6fbIS2/5 54 B444s   C!A%CC&	c                   V P                   P                  4       ;_uu_ 4        V P                   P                  4        V P                   P                  R \        R7       V P                  \        V P                   P                  4       4      ^4       V P                   P                  R\        R7       V P                   P                  R \        R7       V P                  \        V P                   P                  4       4      ^R4       V P                  V P                   P                  4       ^ ,          ^ ,          R R4       RRR4       R#   + '       g   i     R# ; i)rk   rl   r   z(filterwarnings inserted duplicate filterz>filterwarnings did not promote filter to the beginning of listN)r$   rV   rU   rT   rn   r   r   _get_filtersrB   s   &r*   %test_filterwarnings_duplicate_filters1FilterTests.test_filterwarnings_duplicate_filtersL  s    [[''))KK%%'KK&&w&ES!9!9!;<a@KK&&x+&FKK&&w&EDKK,,./: ((*1-a0'( *)))   DEE	c                   V P                   P                  4       ;_uu_ 4        V P                   P                  4        V P                   P                  R \        R7       V P                  \        V P                   P                  4       4      ^4       V P                   P                  R\        R7       V P                   P                  R \        R7       V P                  \        V P                   P                  4       4      ^R4       V P                  V P                   P                  4       ^ ,          ^ ,          R R4       RRR4       R#   + '       g   i     R# ; i)rk   rl   r   &simplefilter inserted duplicate filterz<simplefilter did not promote filter to the beginning of listN)r$   rV   rU   r"   rn   r   r   r   r   s   &r*   #test_simplefilter_duplicate_filters/FilterTests.test_simplefilter_duplicate_filters]  s    [[''))KK%%'KK$$W{$CS!9!9!;<a@KK$$X$DKK$$W{$CDKK,,./8 ((*1-a0'N *)))r   c                H   V P                   P                  R R7      ;_uu_ 4       pV P                   P                  4        V P                   P                  R4       V P                   P                  RR R7       V P                   P                  RR R7       V P                   P	                  R\
        R7       V P                  \        V P                   P                  4       4      ^R4       V P                  \        V4      ^ R4       R	R	R	4       R	#   + '       g   i     R	# ; i)
Tr   r   rk   r   test_append_duplicaterl   r   z+appended duplicate changed order of filtersN)	r$   rV   rU   r"   rP   rn   r   r   r   rp   s   & r*   r   !FilterTests.test_append_duplicatem  s    [[''t'44KK%%'KK$$X.KK$$WT$:KK$$Xd$;KK4{KS!9!9!;<a8 SVQ= 5444s   C!DD!	c                   V P                  \        4      ;_uu_ 4        V P                  P                  R R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  R^ R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  R^ R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  R\
        R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  R^ R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  R\
        R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  RRR7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  R R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  R\
        R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  RRR7       RRR4       R#   + '       g   i     ELy; i  + '       g   i     ELJ; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELW; i  + '       g   i     EL); i  + '       g   i     L; i  + '       g   i     R# ; i)	fooactionNr   )rz   rl   r$   )linenor   )ro   r   r$   rT   r   intr"   r   s   &r*   test_argument_validation$FilterTests.test_argument_validation{  s&   z**KK&&e&4 +y))KK&&x&; *y))KK&&x!&< *y))KK&&x#&> *y))KK&&x&: *y))KK&&x&< *z**KK&&x&; +z**KK$$E$2 +y))KK$$Xc$: *z**KK$$Xb$9 +*% +**)))))))))))))))******))***sw   J+ J?#K&"K'-K;0"L7L#:L7<"MM+J<	?K	K$	'K8	;L	L 	#L4	7M	M	M/	c           	        V P                   P                  V P                   R 7      ;_uu_ 4        V P                   P                  4        V P                   P                  R4       V P                   P                  RR7      ;_uu_ 4        V P                   P	                  R4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   rk   r   r   zThis will be ignoredN)r$   rV   rU   r"   rP   r   s   &r*   +test_catchwarnings_with_simplefilter_ignore7FilterTests.test_catchwarnings_with_simplefilter_ignore  s    [[''t{{';;KK%%'KK$$W-++8+<<  !78 = <; =< <;;s$   AC
	B7	%C
7CC

C	c                   V P                   P                  4       ;_uu_ 4        V P                   P                  4        V P                   P                  R \        R7      ;_uu_ 4        \        P
                  ! 4       ;_uu_ 4       pRpV P                   P                  V4       V P                  \        V P                   P                  \        R4      4       VP                  4       pV P                  W!4       RRR4       RRR4       RRR4       R#   + '       g   i     L"; i  + '       g   i     L-; i  + '       g   i     R# ; i)rk   )r   rm   z&Other types of warnings are not errorsr   N)
r$   rV   rU   FutureWarningr   r~   rP   ro   r   r   )rB   r   	error_msgs   &  r*   *test_catchwarnings_with_simplefilter_error6FilterTests.test_catchwarnings_with_simplefilter_error  s    [[''))KK%%'++ ,   ,,..& HIKK$$Y/%%m&*kk&6&6e8LN#__.FMM)4 / *)
 /.  *))s=   AD8'D%	A3D8D%	 D8D"D%	%D50D88E		r.   N)r0   r1   r2   r3   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r4   rH   r]   s   @r*   ri   ri   v   sw     :.$E
(AA(?	(( ((M(74	$	6" :,95 5r5   ri   c                       ] tR tRt]tRtR# )CFilterTestsi  r.   Nr`   r.   r5   r*   r   r     rb   r5   r   c                       ] tR tRt]tRtR# )PyFilterTestsi  r.   Nre   r.   r5   r*   r   r     rg   r5   r   c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR t]3R ltR tR tR tR tR tR tR tR tR tR tR tR tRt V t!R# )	WarnTestsi  c           	        V P                   P                  R R7      ;_uu_ 4       pV P                   P                  R4       \        ^4       Fz  pRV,          pV P                   P	                  V4       V P                  \        VR,          P                  4      V4       V P                  VR,          P                  \        4       K|  	  RRR4       R#   + '       g   i     R# ; i)Tr   r   zmulti %dNr   )r$   rV   r"   r   rP   r   r   rz   r   rm   rn   )rB   rq   r   r   s   &   r*   test_messageWarnTests.test_message  s    [[''t'44KK$$V,1X!1}  &  QrU]]!3T:aennk:	  5444s   B%CC%	c                   \         R ^*3 F  pV P                  P                  RR7      ;_uu_ 4       pV P                  P                  R4       V P                  P	                  V4       V P                  \        VR,          P                  4      \        \        V4      4      4       R R R 4       K  	  R #   + '       g   i     K  ; i)NTr   r   r   )	r   r$   rV   r"   rP   r   r   rz   rn   )rB   obrq   s   &  r*   test_warn_nonstandard_types%WarnTests.test_warn_nonstandard_types  s    D"%B++4+88A((0  $   QrU]]!3SR5IJ 98 &888s   A5B44Cc           
     R   \        V P                  4      ;_uu_ 4        V P                  P                  R R7      ;_uu_ 4       p\        P                  ! R4       V P                  \        P                  P                  VR,          P                  4      R4       \        P                  ! R4       V P                  \        P                  P                  VR,          P                  4      R4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)Tr   spam1stacklevel.pyspam2Nr   r+   r$   rV   r   innerr   ospathbasenamer   outerrp   s   & r*   test_filenameWarnTests.test_filename  s    DKK((++4+88A##G,  !1!1!B%..!A$35##G,  !1!1!B%..!A$35 9 )(88 )((s$   %DB-D	0DDDD&	c           
        \        V P                  4      ;_uu_ 4        V P                  P                  R R7      ;_uu_ 4       p\        P                  ! R^R7       V P                  \        P                  P                  VR,          P                  4      R4       \        P                  ! R^R7       V P                  \        P                  P                  VR,          P                  4      R4       \        P                  ! R^R7       V P                  \        P                  P                  VR,          P                  4      R4       \        P                  ! R^R7       V P                  \        P                  P                  VR,          P                  4      R4       \        P                  ! R	^R7       V P                  \        P                  P                  VR,          P                  4      R4       \        P                  ! R
RR7       V P                  \        P                  P                  VR,          P                  4      R4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)Tr   spam3r   r  spam4spam5r   spam6zspam6.5spam7i'  z<sys>Nr   r  rp   s   & r*   test_stacklevelWarnTests.test_stacklevel  s    DKK((++4+88A##G:  !1!1!B%..!A$35##G:  !1!1!B%..!A$35 ##G:  !1!1!B%..!A$13##G:  !1!1!B%..!A$35##I!<  !1!1!B%..!A$13 ##G=  !1!1!B%..!A$+-' 9 )(88 )((s$   %I9HI&	I9&I61I99J
	c           	        \         P                  ! R 4       \        V P                  4      ;_uu_ 4        V P                  P	                  RR7      ;_uu_ 4       pV P                  P                  R4       ^ RIpV P                  \        V4      ^4       V P                  V^ ,          P                  \        4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z&test.test_warnings.data.import_warningTr   r   N)r   unloadr+   r$   rV   r"   &test.test_warnings.data.import_warningr   r   r   __file__)rB   rq   tests   &  r*   test_stacklevel_import WarnTests.test_stacklevel_import  s    EFDKK((++4+88A((2=  Q+  19	 9 )(88 )((s$   %C A"C	;C CC  C1	c           
        \        V P                  4      ;_uu_ 4        V P                  P                  R R7      ;_uu_ 4       pV P                  P                  R4       \        P
                  ! R^\        P                  R7       V P                  VR,          P                  \        4       \        P                  ! R^R7       V P                  VR,          P                  \        4       V P                  VR,          P                  VR,          P                  4       \        P                  ! R^R7       V P                  VR,          P                  \        4       \        P                  ! R^ R7       V P                  VR,          P                  \        4       \        P                  ! R	RR7       V P                  VR,          P                  \        4       \        P                  ! R
^R7       V P                  RVR,          P                  4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)Tr   r   	inner_api)r   warnings_modulezpackage apir   zpackage api 1zpackage api 0zpackage api -99prefix02r9   Nr   i)r+   r$   rV   r"   r   r%  r   r   r   r   r   packager   rp   s   & r*   test_skip_file_prefixes!WarnTests.test_skip_file_prefixes  s   DKK((++4+88A((2 ((#(5(>(>@   2:%%mB  2:  22@%%o!D  2:%%o!D  2:%%&7CH  2: %%jQ?j!B%..9+ 9 )(88 )((s$   %H=GH*	H=*H:5H==I	c           	        \        V P                  4      ;_uu_ 4        \        P                  pV P                  P	                  R R7      ;_uu_ 4       p\        P
                  ! RV3R7       RRR4       V P                  \        X4      ^4       V P                  VR,          P                  V4       RRR4       R#   + '       g   i     LX; i  + '       g   i     R# ; i)Tr   r   skip_file_prefixesNr   )
r+   r$   r   r   rV   r  r   r   r   r   )rB   skippedrq   s   &  r*   !test_skip_file_prefixes_file_path+WarnTests.test_skip_file_prefixes_file_path  s    DKK((#,,G++4+88A##EwjI 9 SVQ'"8 )(88 )((s$   5CB=	-AC=CCC!	c           	     @   \        V P                  4      ;_uu_ 4        \        P                  P                  pV P                  \        4      ;_uu_ 4        V! R . R7       RRR4       V P                  \        4      ;_uu_ 4        V! R RR7       RRR4       V P                  \        4      ;_uu_ 4        V! R RR7       RRR4       RRR4       R#   + '       g   i     Lz; i  + '       g   i     L]; i  + '       g   i     L@; i  + '       g   i     R# ; i)r   r-  Nza sequence of strs)s   bytes)r+   r$   r   r   rP   ro   r   )rB   rP   s   & r*   #test_skip_file_prefixes_type_errors-WarnTests.test_skip_file_prefixes_type_errors  s    DKK(( ))..D""9--Ur2 .""9--U{; .""9--U/CD . )(------ )((sS   8DC	!%DC&	%D6C9	DC#D&C61D9D	DD	c                B   R p\        RVR4      pV P                  P                  RR7      ;_uu_ 4       pV P                  P                  R\        R7       \        V4       RRR4       V P                  X^ ,          P                  V4       R#   + '       g   i     L5; i)z<warnings-test>z3import warnings
warnings.warn('hello', UserWarning)execTr   r   rl   N)compiler$   rV   r"   rn   r6  r   r   )rB   r   codeobjrq   s   &   r*   test_exec_filenameWarnTests.test_exec_filename   s~    $ A"F, [[''t'44KK$$X$DM 5 	11 54s   -BB	c           	        V P                   P                  R R7      ;_uu_ 4       pV P                   P                  4        V P                   P                  R\        R7       RR.pV F_  p \
        P                  ! V4       T P                   P                  R\        T^4       T P                  TR,          P                  T4       Ka  	  RRR4       R#   \         d     K{  i ; i  + '       g   i     R# ; i)	Tr   r   rl   u   nonasciié€u   surrogater   Nr   )r$   rV   rU   rT   rn   r  fsencodeUnicodeEncodeErrorrQ   r   r   )rB   rq   	filenamesr   s   &   r*   %test_warn_explicit_non_ascii_filename/WarnTests.test_warn_explicit_non_ascii_filename*  s    [[''t'44KK%%'KK&&x+&F-/@AI%KK) ))&+xK  2: &	 54 *  544s1   AC&+CA	C&C#	C&"C#	#C&&C7	c           
     :   V P                  \        V P                  P                  R \        R R 4       V P                  \        V P                  P                  R R R ^4       V P                  \        \
        3V P                  P                  R \        R ^^*R7       R # )Nregistry)ro   r   r$   rQ   rn   r   r   r   s   &r*   test_warn_explicit_type_errors(WarnTests.test_warn_explicit_type_errors7  s     	)T[[%>%> +tT	; 	)T[[%>%> $a	1 	9n5 KK55 '4R 	 	Ar5   c                     ! R  R\         4      pV P                  \        4      ;_uu_ 4        V P                  P	                  V! 4       4       RRR4       R#   + '       g   i     R# ; i)c                   &   a  ] tR tRt o R tRtV tR# )-WarnTests.test_bad_str.<locals>.BadStrWarningiJ  c                    R RR/,          # )zA bad formatted string %(err)errzthere is no %(err)sr.   r   s   &r*   __str__5WarnTests.test_bad_str.<locals>.BadStrWarning.__str__L  s    7!678 9r5   r.   N)r0   r1   r2   r3   rK  r4   rH   r]   s   @r*   BadStrWarningrH  J  s     9 9r5   rM  N)r   ro   r   r$   rP   )rB   rM  s   & r*   test_bad_strWarnTests.test_bad_strF  sD    	9G 	9 z**KK]_- +***s   !AA)	c           	         ! R  R\         4      p ! R R4      pV P                  \        4      ;_uu_ 4       pV P                  P	                  RR4       RRR4       V P                  R\        XP                  4      4       V P                  \        4      ;_uu_ 4       pV P                  P	                  RV4       RRR4       V P                  R\        VP                  4      4       V P                  \        4      ;_uu_ 4       pV P                  P	                  RV! 4       4       RRR4       V P                  R\        VP                  4      4       V P                  P                  4       ;_uu_ 4        V P                  P                  4        V P                  P                  R4       V P                  V4      ;_uu_ 4       pV P                  P	                  R	V4       RRR4       V P                  R	\        VP                  4      4       V P                  \        4      ;_uu_ 4       pV P                  P	                  R	R4       RRR4       V P                  R	\        VP                  4      4       V P                  V4      ;_uu_ 4       pV P                  P	                  R	V4       RRR4       V P                  VP                  \         4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL@; i  + '       g   i     EL; i  + '       g   i     ELA; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)
c                       ] tR tRtRtR# )6WarnTests.test_warning_classes.<locals>.MyWarningClassiT  r.   Nr/   r.   r5   r*   MyWarningClassrR  T      r5   rS  c                       ] tR tRtRtR# ):WarnTests.test_warning_classes.<locals>.NonWarningSubclassiW  r.   Nr/   r.   r5   r*   NonWarningSubclassrV  W  rT  r5   rW  zbad warning categoryr   Nz)category must be a Warning subclass, not r   zgood warning category)r   ro   r   r$   rP   r   r   	exceptionrV   rU   rT   assertWarnsr   warningrn   assertIsInstance)rB   rS  rW  cms   &   r*   test_warning_classesWarnTests.test_warning_classesS  sT   	W 		 	 y))RKK3R8 *A",,'	) y))RKK35GH *A",,'	) y))RKK3^5EF *A",,'	) [[''))KK%%'KK&&y1!!.11R  !8.I 24c"**oF!!+.."  !8$? /4c"**oF!!.11R  !8.I 2!!"**g6 *)! *))
 *)) *)) 211 /. 21 *))sz   KK2"L6AML	"A
M,L.		AMM	,(MK/	2L	L	L+%	M.L>9MMMM%	c           
        V P                   P                  R R7      ;_uu_ 4       pV P                   P                  R4       V P                   P                  R\        R^VR7       RRR4       V P                  \        X4      ^4       V P                  V^ ,          P                  \        4       V P                  \        V^ ,          P                  4      R4       R#   + '       g   i     L; i)Tr   r   eggsbarr   N)
r$   rV   rT   rQ   rn   r   r   rm   r   rz   )rB   r   rq   s   && r*   check_module_globalsWarnTests.check_module_globalsz  s    [[''t'44KK&&y1KK%%UA- & / 5
 	Q#14QqT\\*F3 54s   A CC-	c                   V P                   \        J d   V P                  V4       R # V P                   P                  RR7      ;_uu_ 4       pV P                   P	                  R4       V P                  V\        P                  ! V4      4      ;_uu_ 4        V P                   P                  R\        R^VR7       R R R 4       R R R 4       V P                  \        X4      ^ 4       R #   + '       g   i     L5; i  + '       g   i     L@; iNTr   r   r`  ra  r   )r$   rf   rb  rV   rT   assertRaisesRegexreescaperQ   rn   r   r   )rB   r   errmsgerrtyperq   s   &&&& r*   check_module_globals_error$WarnTests.check_module_globals_error  s    ;;+%%%n5[[''t'44KK&&x0''61BCC))K#1 * 3 D 5 	Q#	 DC 54s%   A
C;%C(	;C;(C83C;;D	c           
        V P                   \        J d   V P                  V4       R # V P                   P                  RR7      ;_uu_ 4       pV P                   P	                  R4       V P                   P                  R\        R^VR7       R R R 4       V P                  \        X4      ^4       V P                  V^ ,          P                  \        4       V P                  \        V^ ,          P                  4      V4       V P                  V^,          P                  \        4       V P                  \        V^,          P                  4      R4       R #   + '       g   i     L; ire  )r$   rf   rb  rV   rT   rQ   rn   r   r   rm   DeprecationWarningr   rz   )rB   r   r   rq   s   &&& r*   check_module_globals_deprecated)WarnTests.check_module_globals_deprecated  s    ;;+%%%n5[[''t'44KK&&x0KK%%UA- & / 5
 	Q#1(:;QqT\\*C014QqT\\*F3 54s   A EE'	c                ,    V P                  R R/4       R# )r0   ra  Nrb  r   s   &r*   "test_gh86298_no_loader_and_no_spec,WarnTests.test_gh86298_no_loader_and_no_spec  s    !!:u"56r5   c                0    V P                  R RRR/4       R# )r0   ra  
__loader__Nrr  r   s   &r*   'test_gh86298_loader_is_none_and_no_spec1WarnTests.test_gh86298_loader_is_none_and_no_spec  s    !!:ulD"IJr5   c                2    V P                  R RRR/R4       R# )r0   ra  __spec__N+Module globals is missing a __spec__.loaderrk  r   s   &r*   'test_gh86298_no_loader_and_spec_is_none1WarnTests.test_gh86298_no_loader_and_spec_is_none  s    ''
D19	;r5   c                6    V P                  R RRRRR/R4       R# )r0   ra  rv  Nrz  r{  r|  r   s   &r*   ,test_gh86298_loader_is_none_and_spec_is_none6WarnTests.test_gh86298_loader_is_none_and_spec_is_none  s#    ''dJE9	;r5   c                `    V P                  R RRRR\        P                  ! RR7      /R4       R# )r0   ra  rv  Nrz  loaderr{  )rk  typesSimpleNamespacer   s   &r*   3test_gh86298_loader_is_none_and_spec_loader_is_none=WarnTests.test_gh86298_loader_is_none_and_spec_loader_is_none  s1    ''d..d;=9	;r5   c                B    V P                  R RR\        4       /R4       R# )r0   ra  rv  r{  Nro  objectr   s   &r*   test_gh86298_no_specWarnTests.test_gh86298_no_spec  s!    ,,fh79	;r5   c                F    V P                  R RR\        4       RR/R4       R# )r0   ra  rv  rz  Nr{  r  r   s   &r*   test_gh86298_spec_is_none#WarnTests.test_gh86298_spec_is_none  s%    ,,fh
DI9	;r5   c           	     l    V P                  R RR\        4       R\        P                  ! 4       /R4       R# )r0   ra  rv  rz  r{  Nro  r  r  r  r   s   &r*   test_gh86298_no_spec_loader%WarnTests.test_gh86298_no_spec_loader  s1    ,,fh..029	;r5   c                    V P                  R RR\        4       R\        P                  ! \        4       R7      /R4       R# )r0   ra  rv  rz  r  z-Module globals; __loader__ != __spec__.loaderNr  r   s   &r*   ,test_gh86298_loader_and_spec_loader_disagree6WarnTests.test_gh86298_loader_and_spec_loader_disagree  s6    ,,fh..fh?A;	=r5   c                b    V P                  R RR\        P                  ! 4       /R\        4       R# )r0   ra  rz  r{  N)rk  r  r  r   r   s   &r*   )test_gh86298_no_loader_and_no_spec_loader3WarnTests.test_gh86298_no_loader_and_no_spec_loader  s+    ''
E,A,A,CD9>	Kr5   c           	     j    V P                  R RR\        P                  ! \        4       R7      /4       R# )r0   ra  rz  r  N)rb  r  r  r  r   s   &r*   ,test_gh86298_no_loader_with_spec_loader_okay6WarnTests.test_gh86298_no_loader_with_spec_loader_okay  s.    !!..fh?A	Br5   r.   N)"r0   r1   r2   r3   r  r  r  r  r"  r*  r0  r3  r9  r?  rD  rN  r]  rb  r   rk  ro  rs  rw  r}  r  r  r  r  r  r  r  r  r4   rH   r]   s   @r*   r  r    s     ;K5-4::29E2;A.%7N4 JT 
$47K;
;
;;
;
;=K
B Br5   r  c                   *   a  ] tR tRt o ]tR tRtV tR# )
CWarnTestsi  c                    V P                  \        V P                  4       V P                  V P                  P                  R 4       R# __code__N)assertIsNotr&   r$   assertNotHasAttrrP   r   s   &r*   test_acceleratedCWarnTests.test_accelerated  s1    *DKK8dkk..
;r5   r.   N)	r0   r1   r2   r3   ra   r$   r  r4   rH   r]   s   @r*   r  r    s     F< <r5   r  c                   *   a  ] tR tRt o ]tR tRtV tR# )PyWarnTestsi  c                    V P                  \        V P                  4       V P                  V P                  P                  R 4       R# r  )r  r&   r$   rW   rP   r   s   &r*   test_pure_pythonPyWarnTests.test_pure_python  s1    *DKK84;;++Z8r5   r.   N)	r0   r1   r2   r3   rf   r$   r  r4   rH   r]   s   @r*   r  r    s     F9 9r5   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )WCmdLineTestsi  c           	        V P                   P                  4       ;_uu_ 4        V P                  V P                   P                  V P                   P                  R 4       V P                  V P                   P                  V P                   P                  R4       V P                  V P                   P                  V P                   P                  R4       V P                  V P                   P                  4      ;_uu_ 4        V P                   P	                  R4       RRR4       V P                  V P                   P                  4      ;_uu_ 4        V P                   P	                  R4       RRR4       V P                  V P                   P                  4      ;_uu_ 4        V P                   P	                  R4       RRR4       V P                  V P                   P                  R4      ;_uu_ 4        V P                   P	                  R4       RRR4       V P                   P	                  R	4       V P                  \        V P                   P                  R
4       RRR4       R#   + '       g   i     ELU; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)z1:2:3:4:5:6zbogus::Warningzignore:2::4:-5zignore::123Nzignore::123abczignore::===u   Wärningu   ignore::Wärningzerror::Warning::0r   )r$   rV   ro   _OptionError
_setoptionrf  rn   rP   r   s   &r*   test_improper_input!WCmdLineTests.test_improper_input  s    [[''))dkk66"kk44mEdkk66"kk446FHdkk66"kk446FH""4;;#;#;<<&&}5 =""4;;#;#;<<&&'78 =""4;;#;#;<<&&}5 =''(@(@*MM&&'9: NKK""#67k4;;+;+;=OP! *) =<<<<<<<MM *))sm   CJ8I*	5J8I>	/5J8$J	 6J86J%	AJ8*I;5	J8>J		J8J"J8%J50J88K		c           	     2   V P                   P                  4       ;_uu_ 4        V P                   P                  R 4       V P                  V P                   P                  4      ;_uu_ 4        V P                   P                  R4       RRR4       V P                  V P                   P                  4      ;_uu_ 4        V P                   P                  R4       RRR4       V P                   P                  R4       V P                  \
        4      ;_uu_ 4        V P                   P                  R\
        4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L@; i  + '       g   i     R# ; i)zignore::Warningzignore::TestWarningNz ignore::test.test_warnings.bogusz%error::test.test_warnings.TestWarningztest warning)r$   rV   r  ro   r  r-   rP   r   s   &r*   test_import_from_module%WCmdLineTests.test_import_from_module  s    [[''))KK""#45""4;;#;#;<<&&'<= =""4;;#;#;<<&&'IJ =KK""#JK"";//  = 0 *)<<<< 0/ *))sU   A	F,E	5F=E	A F!E2	:FEFE/*F2F=FF	r.   N)r0   r1   r2   r3   r  r  r4   rH   r]   s   @r*   r  r    s     Q*	> 	>r5   r  c                       ] tR tRt]tRtR# )CWCmdLineTestsi  r.   Nr`   r.   r5   r*   r  r    rb   r5   r  c                   0   a  ] tR tRt o ]tR tR tRtV t	R# )PyWCmdLineTestsi  c                J    \        R RR4      w  rpV P                  RV4       R# )z-Wxxx-cpasss0   Invalid -W option ignored: invalid action: 'xxx'N)r   r   rB   rcoutrJ  s   &   r*   test_improper_option$PyWCmdLineTests.test_improper_option  s%     (v>I3Or5   c                    \        R RR4      w  rpV P                  VP                  4       4       V P                  RV4       R# )z-Wir  z?import sys; sys.modules['warnings'].warn('foo', RuntimeWarning)s   RuntimeWarningN)r   assertFalsestripassertNotInr  s   &   r*   test_warnings_bootstrap'PyWCmdLineTests.test_warnings_bootstrap  sA     (tMO 	%*C0r5   r.   N)
r0   r1   r2   r3   rf   r$   r  r  r4   rH   r]   s   @r*   r  r    s     FP1 1r5   r  c                      a  ] tR tRt o ]tR tR tR tR t	R t
R tR tR	 tR
 tR t]P"                  R 4       t]P"                  R 4       t]P"                  R 4       tRtV tR# )_WarningsTestsi#  c           	        V P                   P                  4       ;_uu_ 4       pV P                   P                  R R\        R^ 4       V P	                  \
        V P                   P                  R4       V P                   =V P	                  \
        V P                   P                  R4       RRR4       R#   + '       g   i     R# ; i)rk   r   r   N)r$   rV   rT   r   ro   rn   rP   r!   rp   s   & r*   test_filter_WarningsTests.test_filter)  s    [[''))QKK&&wGRCk4;;+;+; 24#k4;;+;+; 24 *)))s   BB33C	c                    \        R 4      p V P                  P                  p/ sV P                  P	                  RR7      ;_uu_ 4       pV P                  P                  4        V P                  P                  R\         R7       V P                  P                  V\         R^*4       V P                  VR,          P                  V4       VR V P                  P                  V\         R^*4       V P                  \        V4      ^ 4       / V P                  n        / sV P                  P                  R 4       V P                  VR,          P                  P                  VP                  4       VR V P                  =/ sV P                  P                  V\         R^*4       V P                  \        V4      ^ 4       RRR4       W P                  n        R#   + '       g   i     L"; i  XT P                  n        i ; i)	zonceregistry testTr   r   rl   filer   Nr   )rn   r$   onceregistryr   rV   rU   rT   rQ   r   rz   r   rP   r   )rB   rz   original_registryrq   s   &   r*   test_onceregistry _WarningsTests.test_onceregistry3  s    12	9 $ 8 8"$++4+88A))+**6K*H))';K  28aD))';K  Q++-(&(#  !45  2!3!3W\\BaDKK,&(#))';K  Q+% 9( (9KK$) 98( (9DKK$s$   <G* 	E4G=G* G'	"G* *G=c           
     8   \        R 4      pV P                  P                  p V P                  P                  RR7      ;_uu_ 4       pV P                  P	                  4        / pV P                  P                  V\         R^*VR7       V P                  VR	,          P                  V4       V P                  \        V4      ^4       V P                  \        V4      ^4       V P                  RV4       VR V P                  =/ p/ pV P                  P                  V\         R^+VR7       V P                  VR	,          P                  V4       V P                  \        V4      ^4       V P                  \        V4      ^4       VR RV P                  n        / p/ pV P                  P                  V\         R^,VR7       V P                  \        V4      ^ 4       RRR4       W P                  n        R#   + '       g   i     L"; i  Y P                  n        i ; i)
zdefaultaction testTr   z<test>rB  r   r   r   Nr   )
rn   r$   defaultactionrV   rU   rQ   r   rz   r   r   )rB   rz   originalrq   rC  r   s   &     r*   test_default_action"_WarningsTests.test_default_actionP  s   23;;,,	1++4+88A))+))';"5= * ?  28  Q+  X2i2aDKK-&(#))';"5= * ?  28  Q+  X2aD,4)&(#))';"5= * ?  Q+7 9: )1KK%; 98: )1KK%s$   $H FG4H 4H	?H Hc           	     
   V P                   P                  '       d   R # RpV P                   P                  4       ;_uu_ 4        V P                   P                  R\        R7       V P                   =\        P                  ! R4      ;_uu_ 4       pV P                   P                  V4       VP                  4       pR R R 4       R R R 4       V P                  VX4       R #   + '       g   i     L,; i  + '       g   i     L7; i)Nzdel showwarning testr   rl   r   )r$   r   rV   rT   rn   rR   r   captured_outputrP   r   r   )rB   r   streamresults   &   r*   test_showwarning_missing'_WarningsTests.test_showwarning_missingt  s    ;;### %[[''))KK&&x+&F'((22f  &* 3 * 	dF# 32 *)s%   AC2,C	;C2C/*C22D	c           	     H   R pV P                   P                  4       ;_uu_ 4        V P                   P                  R\        R7       V P                   P                  p V P                   =\
        P                  ! R4      ;_uu_ 4       pV P                   P                  V4       VP                  4       pRRR4       W P                   n         RRR4       V P                  VX4       R#   + '       g   i     L=; i  Y P                   n        i ; i  + '       g   i     LL; i)zdel _showwarnmsg testr   rl   r   N)
r$   rV   rT   rn   _showwarnmsgr   r  rP   r   r   )rB   r   showr  r  s   &    r*   test_showwarnmsg_missing'_WarningsTests.test_showwarnmsg_missing  s    &[[''))KK&&x+&F;;++D0KK,,,X66&KK$$T*#__.F 7 ,0( * 	dF# 76 ,0( *)s;   8D*C<,C)	4C<<D)C94C<<DDD!	c           	        V P                   P                  p V P                   P                  4       ;_uu_ 4        V P                   P                  R \        R7       \
        V P                   n        \        P                  ! R4      ;_uu_ 4        V P                   P                  R4       RRR4       ^V P                   n        V P                  \        V P                   P                  R4       RRR4       WP                   n        R#   + '       g   i     Lf; i  + '       g   i     L5; i  YP                   n        i ; i)r   rl   stdoutzWarning!N)r$   rR   rV   rT   rn   printr   r  rP   ro   r   )rB   origs   & r*   test_showwarning_not_callable,_WarningsTests.test_showwarning_not_callable  s    {{&&		+++--**8k*J*/',,X66KK$$Z0 7*,'!!)T[[-=-=zJ . '+KK# 76 .- '+KK#s<   "D/ ADD		+AD/D/ 	DDD,	'D/ /Ec           	     x   V P                   P                  p R pV P                   P                  4       ;_uu_ 4        V P                   P                  R\        R7       V P                   =\
        P                  ! R4      ;_uu_ 4       p\        P                  ! V4       VP                  4       pRRR4       RRR4       V P                  XP                  R4      ^RV,          4       VP                  R^4      w  rV\        P                  P                  \        P                   4      ^ ,          R,           pVP#                  R^4      pVw  rr\%        V
4      p
V P                  Wy4       V P                  VR	\        P&                  ,           4       V P                  VR	V,           4       R
\(        P*                  ! W4      P-                  4       ,           R,           pV P                  Wm4       WP                   n        R#   + '       g   i     ELY; i  + '       g   i     ELe; i  YP                   n        i ; i)ztest show_warningr   rl   r   N
zToo many newlines in %r.py: z  )r$   rR   rV   rT   rn   r   r  r   r  r   r   countsplitr  r  splitextr   rsplitr   r0   	linecachegetliner  )rB   r  r   r  r  
first_linesecond_lineexpected_filefirst_line_partsr  linewarning_classrz   expected_lines   &             r*   test_show_warning_output'_WarningsTests.test_show_warning_output  s   {{&&	+&D++--**8k*JKK+,,X66&!''-#__.F 7 . V\\$/!:V!CE&,ll4&;#JGG,,]-C-CDQG%OM)00a81A.Dt9D]1]C+2F2F,FGWcDj1 9#4#4T#@#F#F#HH4OM[8&*KK## 766 .--( '+KK#s<   $H' AH'G?	/H7D6H' ?H
	HH$		H' 'H9c                   \        4       pVR ,          p V P                  P                  RR7      pV;_uu_ 4       pV P                  P                  R\        R7       RVR &   V P                  P                  R\        4       V P                  \        V4      4       RRR4       W!R &   R#   + '       g   i     L; i  Y!R &   i ; i)r   Tr   r   rl   Nr!  )r<   r$   rV   rT   rn   rP   
assertTruer   )rB   globals_dictoldfilecatchrq   s   &    r*   test_filename_none!_WarningsTests.test_filename_none  s    yz*	/KK..d.;E!**8k*J+/Z(  5A'	  (/$  (/$s#   &B= A!B*B= *B:	5B= =Cc                    \        R R4      w  rpV P                  VR4       V P                  RV4       V P                  RV4       R# )r  zjimport sys; sys.stderr = None; import warnings; warnings.simplefilter('always'); warnings.warn('Warning!')r5   s   Warning!s   ErrorN)r   r   r  rB   r  r  r   s   &   r*   test_stderr_none_WarningsTests.test_stderr_none  sJ    -d()F 	%f-6*r5   c                  a . oV3R  lpV P                   pVP                  4       ;_uu_ 4        VP                  R\        R7       \        P
                  ! 4        \        P                  ! 4       ;_uu_ 4       pVP                  R\        R^V! ^*R7      R7       RRR4       V P                  RXP                  4       4       V P                  S^*.4       \        P
                  ! 4        \        P                  ! VR	R4      ;_uu_ 4        V=\        P                  ! 4       ;_uu_ 4       pVP                  R
\        R^V! ^*.R7      R7       RRR4       V P                  RVP                  4       4       RRR4       V P                  S^*^*..4       \        P
                  ! 4        RRR4       R#   + '       g   i     EL ; i  + '       g   i     L; i  + '       g   i     Lk; i  + '       g   i     R# ; i)c                    <a a  ! V 3R  lR\         4      o ! VVV 3R lR4      pV! 4       p\        P                  P                  RV4      pRVRVRR/# )c                   .   <a  ] tR tRt o V3R ltRtV tR# )M_WarningsTests.test_issue31285.<locals>.get_module_globals.<locals>.BadSourcei  c                   < S# rw   r.   )rB   splitlines_ret_vals   &r*   
splitlinesX_WarningsTests.test_issue31285.<locals>.get_module_globals.<locals>.BadSource.splitlines  s	    --r5   r.   N)r0   r1   r2   r3   r  r4   rH   )rK   r  s   @r*   	BadSourcer    s     . .r5   r  c                   2   <a  ] tR tRt o VVV3R ltRtV tR# )M_WarningsTests.test_issue31285.<locals>.get_module_globals.<locals>.BadLoaderi  c                6   < SP                  S4       S! R 4      # )spamr   )rB   fullnamer  get_source_calledr  s   &&r*   
get_sourceX_WarningsTests.test_issue31285.<locals>.get_module_globals.<locals>.BadLoader.get_source  s    %,,-?@$V,,r5   r.   N)r0   r1   r2   r3   r  r4   rH   )rK   r  r  r  s   @r*   	BadLoaderr    s     - -r5   r  foobarrv  rz  r0   )r   	importlib	machinery
ModuleSpec)r  r  r  specr  r  s   d   @r*   get_module_globals:_WarningsTests.test_issue31285.<locals>.get_module_globals  sS    .C .- -
 [F&&11(FCD &* *r5   r   rl   r   ra  )r  r   NzUserWarning: foor  r`  zUserWarning: eggs)r$   rV   rT   rn   r  
clearcacher   r~   rQ   r   r   r   	swap_attrr  )rB   r  wmodr   r  s   &   @r*   test_issue31285_WarningsTests.test_issue31285  s    	*" {{  ""	K@  "((**f"";q#5#L # N + MM,foo.?@.5  """4>>%,,..&&&UA'9bT'R ' T / 16??3DE ? .bT
;  ") #" +** /. ?> #""sU   A
G+8"F1	A0G+
 G	*#G(G	52G+1G<	G+GG	G(#G++G<	c                   V P                   pVP                  4       ;_uu_ 4        VP                  R 4       \        P                  ! VRR4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        VP                  R\        R^RR7       RRR4       RRR4       RRR4       R#   + '       g   i     L"; i  + '       g   i     L-; i  + '       g   i     R# ; i)r   r  Nr   ra  rB  )	r$   rV   rT   r   r"  ro   r   rQ   r   rB   r#  s   & r*   test_issue31411_WarningsTests.test_issue31411  s     {{  ""'""4>>&&y11&&ugua$&O 2 ? #" 21 ?> #""s;   2CB=	5B*B=	C*B:5B=	=CCC!	c                   V P                   pVP                  4       ;_uu_ 4        R R \        R ^ 3.VP                  4       R&   V P	                  \
        4      ;_uu_ 4        VP                  R\        R^4       R R R 4       . VP                  4       R&   \        P                  ! VRR 4      ;_uu_ 4        V P	                  \
        4      ;_uu_ 4        VP                  R\        R^4       R R R 4       R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     L5; i  + '       g   i     L@; i  + '       g   i     R # ; i)Nr   r   ra  r  )	r$   rV   r   r   ro   r   rQ   r   r"  r'  s   & r*   test_issue31416_WarningsTests.test_issue31416
  s     {{  ""'+T7D!&D%ED"""9--""5'5!< . &(D"""4$??""9--""5'5!< . @ #"--
 .- @? #""sS   ;D> D	9;D>4D+	D+D+	3D>DD>D(#D+	+D;6D>>E	c                ,   V P                   P                  4       ;_uu_ 4        V P                   P                  R \        R7       \        P
                  ! \        4       RR4      ;_uu_ 4        \        P
                  ! \        4       RR4      ;_uu_ 4        V P                  \        V P                   P                  R4       RRR4       RRR4       RRR4       R#   + '       g   i     L"; i  + '       g   i     L-; i  + '       g   i     R# ; i)rk   rl   r0   s   foor   Nra  )	r$   rV   rT   rn   r   	swap_itemr<   ro   rP   r   s   &r*   test_issue31566_WarningsTests.test_issue31566  s     [[''))KK&&w&E""79j&AA""79j$??!!+t{{/?/?G @ B *) @? BA *))s<   A
D-)C/	,CC/	
DC,'C/	/C?:DD	r.   N)r0   r1   r2   r3   ra   r$   r  r  r  r  r  r  r  r  r  r$  r   cpython_onlyr(  r+  r/  r4   rH   r]   s   @r*   r  r  #  s      F49:"1H$$ ++6/++#Z P P = = H Hr5   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )WarningsDisplayTestsi$  c           
        R p\         p\        P                  P                  \        P
                  4      ^ ,          R,           p^p\        P                  ! W44      P                  4       pRpWcWBP                  VV3,          pV P                  WpP                  P                  VW#V4      4       VR,          pWcWBP                  VV3,          pV P                  WpP                  P                  VW#WE4      4       R# )r   r  z%s:%s: %s: %s
  %s
z for the win!N)r   r  r  r  r   r   r  r  r  r0   r   r$   rS   )rB   rz   rm   	file_nameline_num	file_lineformatexpects   &       r*   test_formatwarning'WarningsDisplayTests.test_formatwarning)  s    GG$$]%;%;<Q?%G	%%i:@@B	(h0A0A7%' '!:!:708X"O 	P 	_$	h0A0A7%' '!:!:7$,"N 	Or5   c                x   \         P                  P                  \        P                  4      ^ ,          R,           p^p\
        P                  ! W4      P                  4       pRp\        p\        4       pV P                  P                  WEVV4      pV P                  P                  WEWV4       V P                  VP                  4       V4       VR,          pV P                  P                  WEVW#4      p\        4       pV P                  P                  WEWWc4       V P                  WvP                  4       4       R# )r   r  r   zfor the win!N)r  r  r  r   r   r  r  r  r   r   r$   rS   rR   r   r   )rB   r5  r6  expected_file_linerz   rm   file_objectr9  s   &       r*   test_showwarning%WarningsDisplayTests.test_showwarning;  s   GG$$]%;%;<Q?%G	&..yCIIKj**7i,469 +	---/8n,**7i,4Jj9 +	A!5!5!78r5   c           
     *   R  p\         P                  P                  \        P                  4      ^ ,          R,           p^p\
        P                  ! W#4      P                  4       pRp\        p\        4       pRV RV RV RV 2RV 2,           p\        P                  ! V P                  RV4      ;_uu_ 4        V P                  P                  WVW#Wt4       V P                  VP                  4       V4       R	R	R	4       R	#   + '       g   i     R	# ; i)
c           
      $    R V  RV RV RV RV 2
# )m=:c=:f=:l=:t=r.   )rz   rm   r   r   r   s   &&&&&r*   myformatwarningIWarningsDisplayTests.test_formatwarning_override.<locals>.myformatwarningS  s'    yH:S
#fXSOOr5   r  r   rC  rD  rE  rF  rG  rS   N)r  r  r  r   r   r  r  r  r   r   r   r"  r$   rR   r   r   )	rB   rH  r5  r6  r7  rz   rm   r>  expecteds	   &        r*   test_formatwarning_override0WarningsDisplayTests.test_formatwarning_overrideP  s    	P GG$$]%;%;<Q?%G	%%i:@@B	jyH:S3xjI$%t{{O_MMKK##Gy$/<[113X> NMMMs   9>DD	r.   N)	r0   r1   r2   r3   r:  r?  rK  r4   rH   r]   s   @r*   r3  r3  $  s     
O$9*? ?r5   r3  c                       ] tR tRt]tRtR# )CWarningsDisplayTestsid  r.   Nr`   r.   r5   r*   rN  rN  d  rb   r5   rN  c                   *   a  ] tR tRt o ]tR tRtV tR# )PyWarningsDisplayTestsig  c           	        V P                  \        P                  \        P                  4       \	        \        P                  R RR7      ;_uu_ 4       pVP                  \        P                  ! R4      4       RRR4       R p\        P                  P                  \        P                  4      pV! R\        P                  4      p\        P                  ! RV R24      P                  4       pV P                  WE4       V! RR	R
\        P                  4      p\        P                  ! RV RV RV R24      P                  4       pV P                  WE4       R#   + '       g   i     L; i)rq   utf-8)encodingz
                def func():
                    f = open(__file__, "rb")
                    # Emit ResourceWarning
                    f = None

                func()
            Nc                      \        V R R/ pVP                  P                  RR4      pRP                  VP	                  4       4      p\
        P                  ! RRV4      pV# )PYTHONIOENCODINGrR  replacer  z<.*>z<...>)r   rJ  decodejoinr  rg  sub)r   resr   s   *  r*   run4PyWarningsDisplayTests.test_tracemalloc.<locals>.runw  sU    "DC7CCWW^^GY7FYYv0023F VVFGV4FMr5   -Wdz
            z:5: ResourceWarning: unclosed file <...>
              f = None
            ResourceWarning: Enable tracemalloc to get the object allocation traceback
        z-Xztracemalloc=2z:5: ResourceWarning: unclosed file <...>
              f = None
            Object allocated at (most recent call last):
              File "z7", lineno 7
                func()
              File "z=", lineno 3
                f = open(__file__, "rb")
        )
addCleanupr	   unlinkTESTFNopenwritetextwrapdedentr  r  abspathr  r   )rB   fpr[  r   r   rJ  s   &     r*   test_tracemalloc'PyWarningsDisplayTests.test_tracemallocj  s9   	(()*:*:;)""C'::bHHX__ &   ;	 77??9#3#34UI,,-?? (J 	$  UW	 	
 	* UD/93C3CD?? (J  J J 	$  UW 	 	*Q ;:s   &EE+	r.   N)	r0   r1   r2   r3   rf   r$   rg  r4   rH   r]   s   @r*   rP  rP  g  s     F++ ++r5   rP  c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )CatchWarningTestsi  c                   V P                   P                  '       d   R # V P                   pVP                  pVP                  pVP	                  RR7      ;_uu_ 4        \        4       ;Vn        Vn        R R R 4       V P                  VP                  V4       V P                  VP                  V4       VP	                  RR7      ;_uu_ 4        \        4       ;Vn        Vn        R R R 4       V P                  VP                  V4       V P                  VP                  V4       R #   + '       g   i     L; i  + '       g   i     L]; i)NTr   F)r$   r   r!   rR   rV   r  r   )rB   r#  orig_filtersorig_showwarnings   &   r*   test_catch_warnings_restore-CatchWarningTests.test_catch_warnings_restore  s    ;;###{{||++   --.4h6DL4+ .dllL1d&&(89   ...4h6DL4+ /dllL1d&&(89 .-
 /.s   D'D:'D7	:E
	c                   V P                   pVP                  R R7      ;_uu_ 4       pV P                  V. 4       V P                  \	        V4      \
        4       VP                  R4       VP                  R4       V P                  \        VR,          P                  4      R4       VP                  R4       V P                  \        VR,          P                  4      R4       V P                  \        V^ ,          P                  4      R4       V P                  \        V^,          P                  4      R4       VR V P                  V. 4       RRR4       VP                  pVP                  RR7      ;_uu_ 4       pV P                  V4       V P                  VP                  V4       RRR4       R#   + '       g   i     Ln; i  + '       g   i     R# ; i)	Tr   r   r   ra  r   NFr   )r$   rV   r   r   typer   r"   rP   r   rz   rR   assertIsNone)rB   r#  rq   rm  s   &   r*   test_catch_warnings_recording/CatchWarningTests.test_catch_warnings_recording  s]   {{   --Q#MM$q'4(h'IIeS2/7IIeS2/7S1.6S1.6!Q# .  ++   ..!a MM$**,<= /. .- /..s   D*F7?.G
7G	
G	c                    V P                   pVP                  R R7      pV P                  \        VP                  4       V;_uu_ 4        V P                  \        VP
                  4       RRR4       VP                  RR7      pV P                  \        VP                  4       V;_uu_ 4        V P                  \        VP
                  4       RRR4       R#   + '       g   i     Lw; i  + '       g   i     R# ; i)Tr   NF)r$   rV   ro   RuntimeError__exit__	__enter__)rB   r#  r   s   &  r*   !test_catch_warnings_reentry_guard3CatchWarningTests.test_catch_warnings_reentry_guard  s    {{t,,

3QlAKK8  u-,

3QlAKK8 Q Q
 QQs   	!C.!C,C)	,C=	c                   V P                   pVP                  4       pVP                  pVP                  4       ;_uu_ 4       pV P	                  V4       V P                  VP                  V4       V P                  VP                  4       V4       R R R 4       V P                  VP                  4       V4       V\        P                  R,          J d   VP                  4       ;_uu_ 4       pV P	                  V4       V P                  VP                  V4       V P                  VP                  4       V4       R R R 4       V P                  VP                  4       V4       R # R #   + '       g   i     L; i  + '       g   i     LG; i)Nr   )	r$   r   rR   rV   rr  r   r  r   r>   )rB   r#  rl  rm  rq   s   &    r*   test_catch_warnings_defaults.CatchWarningTests.test_catch_warnings_defaults  s#   {{((*++  ""aa MM$**,<=T..0,? # 	d'')<83;;z**$$&&!!!!$d..0@A  !2!2!4lC ' MM$++-|< + #" '&s   AE$*AE7$E4	7F	c           	       a V P                   P                  '       d   R # RpV P                   p. oRV3R llp\        P                  ! VRV4      ;_uu_ 4        VP	                  RR7      ;_uu_ 4       pV P                  VP                  V4       VP                  R4       VP                  V4       R R R 4       V P                  VP                  V4       R R R 4       V P                  \        X4      ^V4       V P                  V^ ,          P                  P                  ^ ,          V4       V P                  S. 4       R #   + '       g   i     L; i  + '       g   i     L; i)NThis is a warningc                 *   < SP                  V 4       R # rw   r   rz   rm   r   r   r  r  my_logs   &&&&&&r*   	my_loggerLCatchWarningTests.test_record_override_showwarning_before.<locals>.my_logger      MM'"r5   rR   Tr   r   NN)r$   r   r   r"  rV   r  rR   r"   rP   r   r   r   rz   r   rB   r   r#  r  logr  s   &    @r*   'test_record_override_showwarning_before9CatchWarningTests.test_record_override_showwarning_before  s    ;;### "{{	#
 t]I>>$$D$11S  !1!19=!!(+		$	 2 MM$**I6 ? 	S1c*Q,,Q/6$ 21 ?>s$   E3?E	2$EEEE%	c                  a V P                   P                  '       d   R # RpV P                   p. oRV3R llpVP                  RR7      ;_uu_ 4       pVP                  R4       W2n        VP                  V4       R R R 4       V P                  \        S4      ^S4       V P                  S^ ,          P                  ^ ,          V4       V P                  X. 4       R #   + '       g   i     Lj; i)Nr  c                 *   < SP                  V 4       R # rw   r   r  s   &&&&&&r*   r  LCatchWarningTests.test_record_override_showwarning_inside.<locals>.my_logger	  r  r5   Tr   r   r  )	r$   r   rV   r"   rR   rP   r   r   r   r  s   &    @r*   'test_record_override_showwarning_inside9CatchWarningTests.test_record_override_showwarning_inside  s     ;;### "{{	#    --h'(IIdO .
 	Va0*D1b! .-s   )CC-	c           	     r   V P                   pV\        P                  R ,          Jd   V P                  R4       \        P
                  ! RR7      ;_uu_ 4       pV P                  VP                  . 4       VP                  R4       VP                  R4       V P                  \        VP                  4      R4       VP                  R4       V P                  \        VP                  4      R4       V P                  \        VP                  ^ ,          P                  4      R4       V P                  \        VP                  ^,          P                  4      R4       VP                  4        V P                  VP                  . 4       RRR4       \        P
                  ! 4       ;_uu_ 4         RRR4       \        P
                  ! R\        34      ;_uu_ 4        VP                  R4       RRR4       V P                  \        4      ;_uu_ 4        \        P
                  ! R\         34      ;_uu_ 4         RRR4       RRR4       V P                  \        4      ;_uu_ 4        \        P
                  ! R\         34      ;_uu_ 4        VP                  R4       RRR4       RRR4       R#   + '       g   i     EL0; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L{; i  + '       g   i     R# ; i)	r   z,module to test is not loaded warnings moduleFquietr   r   ra  Nr   )r$   r   r>   skipTestr
   check_warningsr   r   r"   rP   r   rz   resetrn   ro   AssertionErrorRuntimeWarning)rB   r#  rq   s   &  r*   test_check_warnings%CatchWarningTests.test_check_warnings  s   {{s{{:..MMHI++%88AQZZ,h'IIeS^U3IIeS^U3SA!6!67?SA!6!67?GGIQZZ, 9 ++-- . ++UK,@AAIIe B ~.. //^0DEE F / ~.. //0GHH		%  I /.- 988 .-- BA FE /.
 IH /..sm   D2J1/KK%K?9K,	;K?(%L%L	L%1K	K	K)	,K<7K??L	L"L%%L6	r.   N)r0   r1   r2   r3   rn  rs  ry  r|  r  r  r  r4   rH   r]   s   @r*   rj  rj    s-     :">*9=$%:"0! !r5   rj  c                       ] tR tRt]tRtR# )CCatchWarningTestsi5  r.   Nr`   r.   r5   r*   r  r  5  rb   r5   r  c                       ] tR tRt]tRtR# )PyCatchWarningTestsi8  r.   Nre   r.   r5   r*   r  r  8  rg   r5   r  c                      a  ] tR tRt o R tR t]R 4       t]R 4       tR t	]
P                  ! ]P                  ! 4       R8g  R4      R	 4       tR
tV tR# )EnvironmentVariableTestsi<  c                N    \        R RRRR7      w  rpV P                  VR4       R# )r  2import sys; sys.stdout.write(str(sys.warnoptions))ignore::DeprecationWarningr   PYTHONWARNINGSPYTHONDEVMODEs   ['ignore::DeprecationWarning']Nr   r   r  s   &   r*   test_single_warning,EnvironmentVariableTests.test_single_warning>  s/    -d@7F 	!BCr5   c                N    \        R RRRR7      w  rpV P                  VR4       R# )r  r  z1ignore::DeprecationWarning,ignore::UnicodeWarningr   r  8   ['ignore::DeprecationWarning', 'ignore::UnicodeWarning']Nr  r  s   &   r*   test_comma_separated_warnings6EnvironmentVariableTests.test_comma_separated_warningsE  s2    -d@NF 	G	Ir5   c                P    \        R RRRRR7      w  rpV P                  VR4       R# )z-Wignore::UnicodeWarningr  r  r  r   r  r  Nr  r  s   &   r*   test_envvar_and_command_line5EnvironmentVariableTests.test_envvar_and_command_lineM  s5    -.H$@7F 	G	Ir5   c                    \        R RRRRR7      w  rpV P                  VR4       V P                  VP                  4       . RO4       R# )	z-Werror::DeprecationWarningr  zjimport sys, warnings; sys.stdout.write(str(sys.warnoptions)); warnings.warn('Message', DeprecationWarning)zdefault::DeprecationWarningr   r  s<   ['default::DeprecationWarning', 'error::DeprecationWarning']N)s"   Traceback (most recent call last):s&     File "<string>", line 1, in <module>sn       import sys, warnings; sys.stdout.write(str(sys.warnoptions)); warnings.warn('Message', DeprecationWarning)sn                                                                     ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^s   DeprecationWarning: Message)r   r   r  r  s   &   r*   (test_conflicting_envvar_and_command_lineAEnvironmentVariableTests.test_conflicting_envvar_and_command_lineV  sV    23PRV;8	F
 	K	M**,-	.r5   c           	     @   V P                   \        J p\        P                  '       d   . pMUV'       d   \        P
                  ! R 4      pMR pRR\        V^ 3RR\        R^ 3RR\        R^ 3RR\        R^ 3RR\        R^ 3.pV Uu. uF  p\        V4      P                  4       NK  	  ppV'       d   RpMRpVR,          p\        RVRR	7      w  rxp	VP                  4        U
u. uF  qP                  4       NK  	  pp
RV n        V P!                  W4       R# u upi u up
i )
__main__r   Nr   zPimport sys; sys.modules.pop('warnings', None); sys.modules['_warnings'] = None; r   z<import warnings; [print(f) for f in warnings._get_filters()]r  T)
__isolated)r$   rf   r   Py_DEBUGrg  r7  rn  PendingDeprecationWarningImportWarningResourceWarningr   encoder   r  r  maxDiffr   )rB   pure_python_apiexpected_default_filtersmain_module_filterr{   expected_outputcoder  r  r   r  stdout_liness   &           r*   !test_default_filter_configuration:EnvironmentVariableTests.test_default_filter_configurationh  s   ++4')$%'ZZ
%;"%/"D"46H!L4!3T1=4!:D!D4a84$:($ 5MM4Lq3q6==?4LMeDDNN-dDTJF171B1B1DE1D

1DE7 N Fs   "D"Dasciiz%requires non-ascii filesystemencodingc                    R \         P                  ,           p\        RRRVRR7      w  r#pV P                  V\	        V.4      P                  4       4       R# )zignore:DeprecationWarningr  r  rR  r   )rU  r  r  N)r	   FS_NONASCIIr   r   r   r  )rB   r  r  r  r   s   &    r*   test_nonascii&EnvironmentVariableTests.test_nonascii  sT     3Y5J5JJ-d@$)	F
 	n%5!6!=!=!?@r5   )r  N)r0   r1   r2   r3   r  r  r   r  r  r  r9   
skipUnlessr   getfilesystemencodingr  r4   rH   r]   s   @r*   r  r  <  sv     DI I I . ."8> 224?@BABAr5   r  c                       ] tR tRt]tRtR# )CEnvironmentVariableTestsi  r.   Nr`   r.   r5   r*   r  r    rb   r5   r  c                       ] tR tRt]tRtR# )PyEnvironmentVariableTestsi  r.   Nre   r.   r5   r*   r  r    rg   r5   r  c                   p   a  ] tR tRt o ]P
                  ]P                  ! ]R4      R 4       4       t	Rt
V tR# )	LocksTesti  zC module is requiredc                    V P                  \        R 4      ;_uu_ 4        \        P                  4        RRR4       R#   + '       g   i     R# ; i)zcannot release un-acquired lockN)rf  rv  ra   _release_lockr   s   &r*   test_release_lock_no_lock#LocksTest.test_release_lock_no_lock  s@     ##-
 
 $$&	
 
 
 
s	   >A	r.   N)r0   r1   r2   r3   r   r1  r9   r  ra   r  r4   rH   r]   s   @r*   r  r    s3     %;<' = 'r5   r  c                   0   a  ] tR tRt o ]tR tR tRtV t	R# )_DeprecatedTesti  c                N   R
p. ROpV F  pRV^ ,           RV^,           2pV\         3pV P                  VR7      ;_uu_ 4        \        P                  ! VRR7      ;_uu_ 4        V P                  P                  RVVR7       RRR4       RRR4       K  	  RpR	p\        P                  ! V\         3RR7      ;_uu_ 4        V P                  P                  RRVR7       RRR4       R#   + '       g   i     Lo; i  + '       g   i     EK  ; i  + '       g   i     R# ; i)   z.*test_warnings.*z\.removeFr  test_warningsr  _versionNz.*test_warnings.*3\.11r     r   finalr   ))      )r  r  )r  r   )r  r  )r  r  r   alphar   r  r  )rn  subTestr
   r  r$   _deprecated)rB   r   r!  r  r   filters   &     r*   test_warning_DeprecatedTest.test_warning  s    (2F&vaykF1I;?C,,FV,,$33F%HHKK++OF5< , > I -,  )'++S2D,EUSSKK##OG-4 $ 6 TS IH -,, TSSs0   !C>%C+C>D+C;6C>>DD$	c                ~   Rp. ROpV Fj  pV P                  VR7      ;_uu_ 4        V P                  \        4      ;_uu_ 4        V P                  P	                  RVVR7       RRR4       RRR4       Kl  	  R Fq  p^^^ V^ 3pV P                  VR7      ;_uu_ 4        V P                  \        4      ;_uu_ 4        V P                  P	                  RR	VR7       RRR4       RRR4       Ks  	  R#   + '       g   i     L; i  + '       g   i     EK  ; i  + '       g   i     LF; i  + '       g   i     K  ; i)
r  r  r  r  N)releaselevelr  ))   r   )r  r  )r  
   )beta	candidater  r  )r  ro   rv  r$   r  )rB   r   r!  r  levels   &    r*   test_RuntimeError!_DeprecatedTest.test_RuntimeError  s    ()FV,,&&|44KK++OF5< , > 5 -, 
 4E"a*G511&&|44KK++OG5< , > 5 21 4 54 -,, 54 211sG   DC0#DD+;DD+0D ;DDD(#D++D<r.   N)
r0   r1   r2   r3   r&   r$   r  r  r4   rH   r]   s   @r*   r  r    s      F6"> >r5   r  c                   &   a  ] tR tRt o R tRtV tR# )BootstrapTesti  c                *   \         P                  ! 4       ;_uu_ 4       p\         P                  ! R 4      ;_uu_ 4        \        RRVR7       \        RRRRVR7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	encodingsr  r  )
PYTHONPATHz-Wr   N)r	   temp_cwdr   )rB   cwds   & r*   test_issue_8766BootstrapTest.test_issue_8766  s`     !!S)*<*<[*I*IT6c: T64cJ +J!!*I*I!!!s"   BA.	B.A>9BB	r.   N)r0   r1   r2   r3   r  r4   rH   r]   s   @r*   r  r    s     	K 	Kr5   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )FinalizationTesti  c                    R p\        RV4      w  r#pV P                  VP                  4       P                  4       R4       R# )zk
import warnings
warn = warnings.warn

class A:
    def __del__(self):
        warn("test")

a=A()
        r  z<string>:7: UserWarning: testN)r   r   rW  rstrip)rB   r  r  r  rJ  s   &    r*   test_finalization"FinalizationTest.test_finalization  s=    	 (d3,,.8	:r5   c                    R pR\         ,          p\        RRV4      w  r4pV P                  WQ4       R\         ,          p\        RRV4      w  r4pV P                  WQ4       R# )s(   <sys>:0: ResourceWarning: unclosed file zf = open(%a)r]  r  zimport warnings; f = open(%a)N)r   r   assertStartsWith)rB   rJ  r  r  r  rJ  s   &     r*   test_late_resource_warning+FinalizationTest.test_late_resource_warning  sa     ? ('tT:c, /9'tT:c,r5   r.   N)r0   r1   r2   r3   r   r  r4   rH   r]   s   @r*   r  r    s     :"- -r5   r  c                      a a ] tR tRt oV 3R lt]P                  ! ]P                  P                  '       * R4      R 4       t
]P                  ! ]P                  P                  '       * R4      R 4       tRtVtV ;t# )
AsyncTestsi  c                X   < \         SV `  4        V P                  P                  4        R # rw   r?   r@   r$   rU   rA   s   &r*   r@   AsyncTests.setUp      !!#r5   zrequires context aware warningsc                  a aaaaaaa ^ RI oSP                  4       oSP                  4       oSP                  4       oSP                  4       oV VVVV3R loV VVVV3R loVVV3R lpSP                  V! 4       4       R# )r   Nc                    <"   SP                   P                  R R7      ;_uu_ 4       p SP                  4       G Rj  xL
  SP                   P                  R\        4       SP                  4        SP                  4       G Rj  xL
  SP                  \        V 4      ^4       SP                  V ^ ,          P                  P                  ^ ,          R4       SP                  4        RRR4       R#  L Lo  + '       g   i     R# ; i5i)Tr   Nrun_a warning)
r$   rV   waitrP   rn   rY   r   r   rz   r   rq   rB   step_a1step_a2step_b1step_b2s    r*   run_a,AsyncTests.test_async_context.<locals>.run_a  s     ++4+88Alln$$   +>lln$$  Q+  1!2!21!5G 98$
 % 988s@   %D
C6C2AC6C4A#C6(
D
2C64C66D		D
c                    <"   SP                   P                  R R7      ;_uu_ 4       p SP                  4        SP                  4       G Rj  xL
  SP                   P	                  R\
        4       SP                  4        SP                  4       G Rj  xL
  SP                  \        V 4      ^4       SP                  V ^ ,          P                  P                  ^ ,          R4       RRR4       R#  L L_  + '       g   i     R# ; i5i)Tr   Nrun_b warning)
r$   rV   rY   r  rP   rn   r   r   rz   r   r  s    r*   run_b,AsyncTests.test_async_context.<locals>.run_b  s     ++4+88Alln$$   +>lln$$  Q+  1!2!21!5G 98$
 % 988sB   %D
$C6C2AC6C4AC6(
D
2C64C66D		D
c                  \   <"   S P                  S! 4       S! 4       4      G R j  xL
  R #  L5irw   )gather)asyncior  r  s   r*   	run_tasks0AsyncTests.test_async_context.<locals>.run_tasks+  s     ..%'222s    ,*,r  Eventr[  )	rB   r  r  r  r  r  r  r  r  s	   f @@@@@@@r*   test_async_contextAsyncTests.test_async_context  sa     	 --/--/--/--/
	 
	
	H 
	H	3 	IK r5   c                   a aaaaa ^ RI oSP                  4       oSP                  4       oV VV3R loV VV3R loVVVV 3R lpSP                  V! 4       4       R# )r   Nc                     <"   SP                  4       G R j  xL
  S P                  P                  R\        4       SP	                  4        R #  L65i)Nchild warning)r  r$   rP   rn   rY   )rB   step1step2s   r*   
run_child16AsyncTests.test_async_task_inherit.<locals>.run_child1;  s9     **, KK_k:IIK	 s   AA7Ac                     <"   SP                   P                  R R7      ;_uu_ 4       p SP                  4        SP                  4       G Rj  xL
  RRR4       R#  L  + '       g   i     R# ; i5i)Tr   N)r$   rV   rY   r  )rq   rB   r'  r(  s    r*   
run_child26AsyncTests.test_async_task_inherit.<locals>.run_child2B  sP      ++4+88A		jjl"" 98" 988s.   %A1$AAA
A1AA.	(	A1c                  |  <"   SP                   P                  R R7      ;_uu_ 4       p SP                  S! 4       S! 4       4      G Rj  xL
  SP                  \	        V 4      ^4       SP                  V ^ ,          P
                  P                  ^ ,          R4       RRR4       R#  L]  + '       g   i     R# ; i5i)Tr   Nr&  )r$   rV   r  r   r   rz   r   )rq   r  r)  r,  rB   s    r*   
run_parent6AsyncTests.test_async_task_inherit.<locals>.run_parentJ  s     ++4+88AnnZ\:<@@@  Q+  1!2!21!5G 98@ 988s/   %B< B(B&	AB(
B<&B((B9	3	B<r   )rB   r/  r  r)  r,  r'  r(  s   f @@@@@r*   test_async_task_inherit"AsyncTests.test_async_task_inherit0  sD     			#	H 	H 	JL!r5   r.   )r0   r1   r2   r3   r@   r9   skipIfr   flagscontext_aware_warningsr"  r1  r4   rH   rI   rJ   s   @@r*   r  r    sn     $ __99968$!8$!L __99968"8" "r5   r  c                       ] tR tRt]tRtR# )CAsyncTestsiS  r.   Nr`   r.   r5   r*   r7  r7  S  rb   r5   r7  c                       ] tR tRt]tRtR# )PyAsyncTestsiW  r.   Nre   r.   r5   r*   r9  r9  W  rg   r5   r9  c                      a a ] tR tRt o]P
                  P                  ;'       d    ]P
                  P                  tV 3R lt	]
P                  ! ]'       * R4      R 4       tRtVtV ;t# )ThreadTestsi[  c                X   < \         SV `  4        V P                  P                  4        R # rw   r	  rA   s   &r*   r@   ThreadTests.setUpd  r  r5   z#requires thread-safe warnings flagsc                z   a aaaa ^ RI oSP                  ^^R7      oVV 3R loVV 3R loVVV V3R lpV! 4        R# )r   N)timeoutc                    < SP                   P                  R R7      ;_uu_ 4       p SP                  4        SP                   P                  R\        4       SP                  4        SP                  \        V 4      ^4       SP                  V ^ ,          P                  P                  ^ ,          R4       RRR4       SP                   P                  R\        4       R#   + '       g   i     L2; i)Tr   r  Nmain warning	r$   rV   r  rP   rn   r   r   rz   r   rq   barrierrB   s    r*   r  0ThreadTests.test_threaded_context.<locals>.run_ao  s    ++4+88A   +>  Q+  1!2!21!5G 9 KK^[9 98   BC  C0	c                    < SP                   P                  R R7      ;_uu_ 4       p SP                  4        SP                  4        SP                   P                  R\        4       SP                  \        V 4      ^4       SP                  V ^ ,          P                  P                  ^ ,          R4       RRR4       SP                   P                  R\        4       R#   + '       g   i     L2; i)Tr   r  NrA  rB  rC  s    r*   r  0ThreadTests.test_threaded_context.<locals>.run_b{  s    ++4+88A   +>  Q+  1!2!21!5G 9 KK^[9 98rF  c                  <  < SP                  SR 7      SP                  SR 7      .p SP                  P                  RR7      ;_uu_ 4       pV  F  pVP                  4        K  	  V  F  pVP	                  4        K  	  SP                  \        V4      ^4       SP                  V^ ,          P                  P                  ^ ,          R4       SP                  V^,          P                  P                  ^ ,          R4       RRR4       R#   + '       g   i     R# ; i))targetTr   rA  N)	Threadr$   rV   startrX  r   r   rz   r   )threadsrq   threadr  r  rB   	threadings      r*   run_threads6ThreadTests.test_threaded_context.<locals>.run_threads  s       .   .G ++4+88A%FLLN &%FKKM &  Q+  1!2!21!5~F  1!2!21!5~F 9888s   
B6D

D	)rO  Barrier)rB   rP  rD  r  r  rO  s   f @@@@r*   test_threaded_context!ThreadTests.test_threaded_contexth  s:     	##Aq#1
	:
	:	G 	G 	r5   r.   )r0   r1   r2   r3   r   r4  r5  thread_inherit_contextENABLE_THREAD_TESTSr@   r9   r3  rS  r4   rH   rI   rJ   s   @@r*   r;  r;  [  s`      99;; < <99;; $ __,,:<+<+ +r5   r;  c                       ] tR tRt]tRtR# )CThreadTestsi  r.   Nr`   r.   r5   r*   rX  rX    rb   r5   rX  c                       ] tR tRt]tRtR# )PyThreadTestsi  r.   Nre   r.   r5   r*   rZ  rZ    rg   r5   rZ  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )DeprecatedTestsi  c                $   \        R 4       ! R R4      4       pV P                  VP                  R 4       V P                  V\        4       \        R4      R 4       pV P                  VP                  R4       V P                  V\
        P                  4       \        \        R4      R R l4       4       p\        R R	 l4       pR
 p\        V4      pV P                  \        V4      ^4       V P                  V^ ,          P                  R4       R# )A will go away soonc                       ] tR tRtRtR# )1DeprecatedTests.test_dunder_deprecated.<locals>.Ai  r.   Nr/   r.   r5   r*   Ar`        r5   ra  b will go away soonc                      R # rw   r.   r.   r5   r*   r   1DeprecatedTests.test_dunder_deprecated.<locals>.b      r5   zno more intsc                0    V ^8  d   QhR\         R\         /# r  r   return)r   )r8  s   "r*   __annotate__<DeprecatedTests.test_dunder_deprecated.<locals>.__annotate__      !!!!r5   c                     R # rw   r.   r   s   &r*   h1DeprecatedTests.test_dunder_deprecated.<locals>.h  s    !r5   c                0    V ^8  d   QhR\         R\         /# rh  )r   )r8  s   "r*   rj  rk    rl  r5   c                     R # rw   r.   rn  s   &r*   ro  rp    s    !r5   c                     V # rw   r.   rn  s   &r*   ro  rp    s    Hr5   N)
r   r   __deprecated__r[  rq  r  FunctionTyper   r   r   )rB   ra  r   ro  	overloadss   &    r*   test_dunder_deprecated&DeprecatedTests.test_dunder_deprecated  s    	)	*	 	 
+	 	))+@Aa&	)	*	 
+	 	))+@Aa!3!34		N	#! 
$ 
!	! 
!	 "!$	Y+144nEr5   c           	        \        R 4       ! R R4      4       pV P                  \        R 4      ;_uu_ 4        V! 4        RRR4       V P                  \        R 4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        V! ^*4       RRR4       RRR4       R#   + '       g   i     Lg; i  + '       g   i     L-; i  + '       g   i     R# ; i)r^  c                       ] tR tRtRtR# )%DeprecatedTests.test_class.<locals>.Ai  r.   Nr/   r.   r5   r*   ra  r{    rb  r5   ra  N)r   assertWarnsRegexrn  ro   r   )rB   ra  s   & r*   
test_classDeprecatedTests.test_class  s    	)	*	 	 
+	 ""#57LMMC N""#57LMM""9--" . NM NM .- NMMs/   B%C	B1	CB.	1C<CC	c                    \        R 4       ! R R4      4       pV P                  \        R 4      ;_uu_ 4        V! ^*4      pRRR4       V P                  XP                  ^*4       R#   + '       g   i     L.; i)zHasInit will go away soonc                   &   a  ] tR tRt o R tRtV tR# )5DeprecatedTests.test_class_with_init.<locals>.HasIniti  c                    Wn         R # rw   rn  rB   r   s   &&r*   __init__>DeprecatedTests.test_class_with_init.<locals>.HasInit.__init__      r5   rn  Nr0   r1   r2   r3   r  r4   rH   r]   s   @r*   HasInitr    s      r5   r  N)r   r|  rn  r   r   )rB   r  instances   &  r*   test_class_with_init$DeprecatedTests.test_class_with_init  sc    	/	0	 	 
1	 ""#57RSSr{H TR( TSs   	A&&A6	c                   a R o\        R4       ! V3R lR4      4       pV P                  \        R4      ;_uu_ 4        V! ^*4      pRRR4       V P                  XP                  ^*4       V P                  S4       R#   + '       g   i     L?; i)FzHasNew will go away soonc                   H   <a a ] tR tRt oV V3R ltV3R lR ltRtVtV ;t# )3DeprecatedTests.test_class_with_new.<locals>.HasNewi  c                &   < R o\         SV `  V 4      # Tr?   __new__)clsr   rC   has_new_calleds   &&r*   r  ;DeprecatedTests.test_class_with_new.<locals>.HasNew.__new__  s    !%ws++r5   c                   < V ^8  d   QhRR/# r  ri  Nr.   )r8  rK   s   "r*   rj  @DeprecatedTests.test_class_with_new.<locals>.HasNew.__annotate__        T r5   c                    Wn         R # rw   rn  r  s   &&r*   r  <DeprecatedTests.test_class_with_new.<locals>.HasNew.__init__  r  r5   rn  	r0   r1   r2   r3   r  r  r4   rH   rI   )rC   rK   r  s   @@r*   HasNewr    s     ,
  r5   r  Nr   r|  rn  r   r   r  )rB   r  r  r  s   &  @r*   test_class_with_new#DeprecatedTests.test_class_with_new  su    	.	/	 	 
0	 ""#57QRRbzH SR(' SR   	A==B	c                6  a R o ! V3R lR4      p\        R4       ! R RV4      4       pV P                  \        R4      ;_uu_ 4        V! ^*4      pRRR4       V P                  XP                  ^*4       V P                  S4       R#   + '       g   i     L?; i)Fc                   H   <a a ] tR tRt oV V3R ltV3R lR ltRtVtV ;t# )>DeprecatedTests.test_class_with_inherited_new.<locals>.NewBasei  c                &   < R o\         SV `  V 4      # r  r  )r  r   rC   new_base_calleds   &&r*   r  FDeprecatedTests.test_class_with_inherited_new.<locals>.NewBase.__new__  s    "&ws++r5   c                   < V ^8  d   QhRR/# r  r.   )r8  rK   s   "r*   rj  KDeprecatedTests.test_class_with_inherited_new.<locals>.NewBase.__annotate__  r  r5   c                    Wn         R # rw   rn  r  s   &&r*   r  GDeprecatedTests.test_class_with_inherited_new.<locals>.NewBase.__init__  r  r5   rn  r  )rC   rK   r  s   @@r*   NewBaser    s     ,
  r5   r  z!HasInheritedNew will go away soonc                       ] tR tRtRtR# )FDeprecatedTests.test_class_with_inherited_new.<locals>.HasInheritedNewi  r.   Nr/   r.   r5   r*   HasInheritedNewr    rb  r5   r  Nr  )rB   r  r  r  r  s   &   @r*   test_class_with_inherited_new-DeprecatedTests.test_class_with_inherited_new  s    	 	 
7	8	g 	 
9	 ""#57Z[[&r*H \R(( \[s   	BB	c                   a R o\        R4       ! V3R lR4      4       pV P                  \        R4      ;_uu_ 4        V! ^*4      pRRR4       V P                  XP                  ^*4       V P                  S4       R#   + '       g   i     L?; i)FzHasNewNoInit will go away soonc                   6   <a a ] tR tRt oV V3R ltRtVtV ;t# )EDeprecatedTests.test_class_with_new_but_no_init.<locals>.HasNewNoIniti  c                6   < R o\         SV `  V 4      pWn        V# r  )r?   r  r   )r  r   objrC   
new_calleds   && r*   r  MDeprecatedTests.test_class_with_new_but_no_init.<locals>.HasNewNoInit.__new__  s     !
goc*
r5   r.   r0   r1   r2   r3   r  r4   rH   rI   )rC   rK   r  s   @@r*   HasNewNoInitr    s      r5   r  Nr  )rB   r  r  r  s   &  @r*   test_class_with_new_but_no_init/DeprecatedTests.test_class_with_new_but_no_init  sv    
	4	5	 	 
6	 ""#57WXX#B'H YR(
# YXr  c                   \        R 4       ! R R4      4       p ! R R4      pV P                  \        R 4      ;_uu_ 4         ! R RW!4      pRRR4       X! ^*4      pV P                  VP                  ^*4       R#   + '       g   i     L6; i)zMixin will go away soonc                       ] tR tRtRtR# )/DeprecatedTests.test_mixin_class.<locals>.Mixini
  r.   Nr/   r.   r5   r*   Mixinr  
  rb  r5   r  c                   2   a  ] tR tRt o V 3R lR ltRtV tR# ).DeprecatedTests.test_mixin_class.<locals>.Basei  c                   < V ^8  d   QhRR/# r  r.   )r8  rK   s   "r*   rj  ;DeprecatedTests.test_mixin_class.<locals>.Base.__annotate__  r  r5   c                    Wn         R # rw   r   )rB   r   s   &&r*   r  7DeprecatedTests.test_mixin_class.<locals>.Base.__init__  r  r5   r  Nr  r]   s   @r*   Baser    s      r5   r  c                       ] tR tRtRtR# )/DeprecatedTests.test_mixin_class.<locals>.Childi  r.   Nr/   r.   r5   r*   Childr        r5   r  N)r   r|  rn  r   r   )rB   r  r  r  r  s   &    r*   test_mixin_class DeprecatedTests.test_mixin_class	  s{    	-	.	 	 
/		 	 ""#57PQQ  R 9R( RQs   A;;B	c           	     (  aa R oRo\        R4       ! VV3R lR\        4      4       pV P                  \        R4      ;_uu_ 4         ! R RVRR7      pRRR4       V P	                  S4       V P                  SR4       R#   + '       g   i     L5; i)	FNzMyMeta will go away soonc                   <   <a a ] tR tRt oRV VV3R lltRtVtV ;t# )ADeprecatedTests.test_do_not_shadow_user_arguments.<locals>.MyMetai  c                ,   < R oVo\         SV `  WW#4      # r  r  )mcsnamebasesattrsr  rC   r  new_called_clss   &&&&&r*   r  IDeprecatedTests.test_do_not_shadow_user_arguments.<locals>.MyMeta.__new__  s    !
!$ws%??r5   r.   rw   r  )rC   rK   r  r  s   @@r*   MyMetar    s     @ @ @r5   r  c                       ] tR tRtRtR# )>DeprecatedTests.test_do_not_shadow_user_arguments.<locals>.Fooi&  r.   Nr/   r.   r5   r*   Foor  &  r  r5   r  haha)	metaclassr  )r   rq  r|  rn  r  r   )rB   r  r  r  r  s   &  @@r*   !test_do_not_shadow_user_arguments1DeprecatedTests.test_do_not_shadow_user_arguments  s    
	.	/	@ 	@T 	@ 
0	@ ""#57QRRF  S 	
#0 SRs   BB	c                   \        R 4       ! R R4      4       pV P                  \        R 4      ;_uu_ 4        V! 4        RRR4       V P                  \        R 4      ;_uu_ 4         ! R RV4      pRRR4       V P                  XP                  4       V P                  V! 4       V4       R#   + '       g   i     Lv; i  + '       g   i     LW; i)C will go away soonc                   2   a  ] tR tRt o V 3R lR ltRtV tR# )6DeprecatedTests.test_existing_init_subclass.<locals>.Ci-  c                   < V ^8  d   QhRR/# r  r.   )r8  rK   s   "r*   rj  CDeprecatedTests.test_existing_init_subclass.<locals>.C.__annotate__/  s     " "$ "r5   c                    R V n         R# )TNinited)r  s   &r*   __init_subclass__HDeprecatedTests.test_existing_init_subclass.<locals>.C.__init_subclass__/  s	    !
r5   r.   Nr0   r1   r2   r3   r  r4   rH   r]   s   @r*   Cr  -  s     " "r5   r  Nc                       ] tR tRtRtR# )6DeprecatedTests.test_existing_init_subclass.<locals>.Di6  r.   Nr/   r.   r5   r*   Dr  6  r  r5   r  )r   r|  rn  r  r  r[  )rB   r  r  s   &  r*   test_existing_init_subclass+DeprecatedTests.test_existing_init_subclass,  s    	)	*	" 	" 
+	" ""#57LMMC N ""#57LMMA  N 	!ac1% NM NMs   B-%C -B=	 C	c           	         ! R  R4      p\        R4       ! R RV^*R7      4       pV P                  VP                  ^*4       V P                  \        R4      ;_uu_ 4        V! 4        RRR4       V P                  \        R4      ;_uu_ 4         ! R RV^R7      pRRR4       V P                  XP                  ^4       R#   + '       g   i     Lb; i  + '       g   i     LA; i)	c                   2   a  ] tR tRt o V 3R lR ltRtV tR# )ADeprecatedTests.test_existing_init_subclass_in_base.<locals>.Basei=  c                   < V ^8  d   QhRR/# r  r.   )r8  rK   s   "r*   rj  NDeprecatedTests.test_existing_init_subclass_in_base.<locals>.Base.__annotate__>  s      T r5   c                    Wn         R # rw   r  )r  r   s   &&r*   r  SDeprecatedTests.test_existing_init_subclass_in_base.<locals>.Base.__init_subclass__>  s    
r5   r.   Nr  r]   s   @r*   r  r  =  s      r5   r  r  c                       ] tR tRtRtR# )>DeprecatedTests.test_existing_init_subclass_in_base.<locals>.CiA  r.   Nr/   r.   r5   r*   r  r  A  rb  r5   r  rn  Nc                       ] tR tRtRtR# )>DeprecatedTests.test_existing_init_subclass_in_base.<locals>.DiK  r.   Nr/   r.   r5   r*   r  r  K  r  r5   r  )r   r   r  r|  rn  )rB   r  r  r  s   &   r*   #test_existing_init_subclass_in_base3DeprecatedTests.test_existing_init_subclass_in_base<  s    	 	 
)	*	 	 
+	 	2&""#57LMMC N ""#57LMMA  N 	1% NM NMs    CCC	C%	c                  a R o\        R4       ! V3R lR4      4       pV P                  S4       V P                  \        R4      ;_uu_ 4         ! R RV4      pR R R 4       V P	                  SX4       R #   + '       g   i     L$; i)NBase will go away soonc                   :   <a  ] tR tRt o V 3R lV3R lltRtV tR# )@DeprecatedTests.test_init_subclass_has_correct_cls.<locals>.BaseiS  c                   < V ^8  d   QhRR/# r  r.   )r8  rK   s   "r*   rj  MDeprecatedTests.test_init_subclass_has_correct_cls.<locals>.Base.__annotate__U       ( ($ (r5   c                   < V oR # rw   r.   r  init_subclass_saws   &r*   r  RDeprecatedTests.test_init_subclass_has_correct_cls.<locals>.Base.__init_subclass__U  s	    $'!r5   r.   Nr  rK   r	  s   @r*   r  r  S  s     ( ( (r5   r  c                       ] tR tRtRtR# )=DeprecatedTests.test_init_subclass_has_correct_cls.<locals>.Ci\  r.   Nr/   r.   r5   r*   r  r  \  r  r5   r  r   rr  r|  rn  r   rB   r  r  r	  s   &  @r*   "test_init_subclass_has_correct_cls2DeprecatedTests.test_init_subclass_has_correct_clsP  sy     	,	-	( 	( 
.	(
 	+,""#57OPPD  Q 	'+	 QP   A66B	c                  a R o\        R4       ! V3R lR4      4       pV P                  S4       V P                  \        R4      ;_uu_ 4         ! R RV4      pR R R 4       V P	                  SX4       R #   + '       g   i     L$; i)Nr  c                   D   <a  ] tR tRt o ]V 3R lV3R ll4       tRtV tR# )JDeprecatedTests.test_init_subclass_with_explicit_classmethod.<locals>.Baseid  c                   < V ^8  d   QhRR/# r  r.   )r8  rK   s   "r*   rj  WDeprecatedTests.test_init_subclass_with_explicit_classmethod.<locals>.Base.__annotate__g  r  r5   c                   < V oR # rw   r.   r  s   &r*   r  \DeprecatedTests.test_init_subclass_with_explicit_classmethod.<locals>.Base.__init_subclass__f  s     %(!r5   r.   N)r0   r1   r2   r3   classmethodr  r4   rH   r  s   @r*   r  r  d  s     ( ( (r5   r  c                       ] tR tRtRtR# )GDeprecatedTests.test_init_subclass_with_explicit_classmethod.<locals>.Cin  r.   Nr/   r.   r5   r*   r  r  n  r  r5   r  r  r  s   &  @r*   ,test_init_subclass_with_explicit_classmethod<DeprecatedTests.test_init_subclass_with_explicit_classmethoda  sy     	,	-	( 	( 
.	( 	+,""#57OPPD  Q 	'+	 QPr  c                    \        R 4      R 4       pV P                  \        R 4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     R# ; i)rc  c                      R # rw   r.   r.   r5   r*   r   (DeprecatedTests.test_function.<locals>.bt  rf  r5   N)r   r|  rn  )rB   r   s   & r*   test_functionDeprecatedTests.test_functions  sF    	)	*	 
+	 ""#57LMMC NMMMs   AA	c                     ! R  R4      pV! 4       pV P                  \        R4      ;_uu_ 4        VP                  4        RRR4       R#   + '       g   i     R# ; i)c                   <   a  ] tR tRt o ]! R4      R 4       tRtV tR# )-DeprecatedTests.test_method.<locals>.Capybarai|  x will go away soonc                    R # rw   r.   r   s   &r*   r   /DeprecatedTests.test_method.<locals>.Capybara.x}      r5   r.   N)r0   r1   r2   r3   r   r   r4   rH   r]   s   @r*   Capybarar&  |  s     -. /r5   r+  r'  N)r|  rn  r   rB   r+  r  s   &  r*   test_methodDeprecatedTests.test_method{  sC    	 	
 :""#57LMMJJL NMMMs   AA	c                
    ! R  R4      pV! 4       pV P                  \        R4      ;_uu_ 4        VP                   RRR4       \        P	                  4       ;_uu_ 4        \        P                  R4       V P                  VP                  ^*4       RRR4       V P                  \        R4      ;_uu_ 4        ^*Vn        RRR4       R#   + '       g   i     L; i  + '       g   i     LS; i  + '       g   i     R# ; i)c                      a  ] tR tRt o ]]! R4      R 4       4       t]R 4       t]P                  ]! R4      R 4       4       tRt	V t
R# )	/DeprecatedTests.test_property.<locals>.Capybarai  r'  c                    R # rw   r.   r   s   &r*   r   1DeprecatedTests.test_property.<locals>.Capybara.x       r5   c                    ^*# )*   r.   r   s   &r*   no_more_setting?DeprecatedTests.test_property.<locals>.Capybara.no_more_setting  s    r5   no more settingc                    R # rw   r.   )rB   values   &&r*   r7  r8    r4  r5   r.   N)r0   r1   r2   r3   propertyr   r   r7  setterr4   rH   r]   s   @r*   r+  r1    sa     -. /    ##)* + $r5   r+  r'  Nrk   r9  )r|  rn  r   rf   rV   r"   r   r7  r,  s   &  r*   test_propertyDeprecatedTests.test_property  s    	 	 :""#57LMMJJ N ''))$$W-X55r: * ""#57HII')H$ JI NM *) JIIs#   C!2C9C1C	C.	1D	c                    \        R \        R7      R 4       pV P                  \        R 4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     R# ; i)zc will go away soonrl   c                      R # rw   r.   r.   r5   r*   c(DeprecatedTests.test_category.<locals>.c  rf  r5   N)r   r  r|  )rB   rB  s   & r*   test_categoryDeprecatedTests.test_category  sH    	)N	C	 
D	 "">3HIIC JIIIs   AA	c                    \        R RR7      R 4       p\        P                  4       ;_uu_ 4        \        P                  R4       V! 4        RRR4       R#   + '       g   i     R# ; i)zd will go away soonNrl   c                      R # rw   r.   r.   r5   r*   d1DeprecatedTests.test_turn_off_warnings.<locals>.d  rf  r5   rk   )r   rf   rV   r"   rB   rH  s   & r*   test_turn_off_warnings&DeprecatedTests.test_turn_off_warnings  sO    	)D	9	 
:	 ''))$$W-C *)))s   AA(	c                .   V P                  \        R 4      ;_uu_ 4        \         ! R R4      4       pRRR4       V P                  \        R4      ;_uu_ 4        \        R 4       pRRR4       R#   + '       g   i     LE; i  + '       g   i     R# ; i)z8Expected an object of type str for 'message', not 'type'c                       ] tR tRtRtR# )6DeprecatedTests.test_only_strings_allowed.<locals>.Fooi  r.   Nr/   r.   r5   r*   r  rO    s    r5   r  Nz<Expected an object of type str for 'message', not 'function'c                      R # rw   r.   r.   r5   r*   r   6DeprecatedTests.test_only_strings_allowed.<locals>.foo  s    r5   )rf  r   r   )rB   r  r   s   &  r*   test_only_strings_allowed)DeprecatedTests.test_only_strings_allowed  s    ##F
 
 N 
 ##J
 
  
 

 

 
 
s   A0B0B 	B	c                    \        R 4      R 4       pT P                  \        ;QJ d2    R VP                   4       F  '       g   K   R4       R# 	  R4       R# ! R VP                   4       4      4       R# )deprc                      R # rw   r.   r.   r5   r*   rH  JDeprecatedTests.test_no_retained_references_to_wrapper_instance.<locals>.d  s    r5   c              3   V   "   T F  p\        VP                  \        4      x  K!  	  R # 5irw   )
isinstancecell_contentsr   ).0cells   & r*   	<genexpr>RDeprecatedTests.test_no_retained_references_to_wrapper_instance.<locals>.<genexpr>  s#      
CP4Jt)):66=s   ')TFN)r   r  any__closure__rJ  s   & r*   /test_no_retained_references_to_wrapper_instance?DeprecatedTests.test_no_retained_references_to_wrapper_instance  s`    	F	 
 
CD==
 	 	 
CD==
 
 	r5   c                   \        R 4      R 4       p\        R 4      R 4       p ! R R4      pV P                  \        P                  ! V4      4       V P	                  \        P                  ! V4      4       V P                  \        P                  ! VP
                  4      4       V P	                  \        P                  ! VP                  4      4       R# )rU  c                      R # rw   r.   r.   r5   r*   sync*DeprecatedTests.test_inspect.<locals>.sync  rf  r5   c                     "   R # 5irw   r.   r.   r5   r*   coro*DeprecatedTests.test_inspect.<locals>.coro  s        c                   X   a  ] tR tRt o ]! R4      R 4       t]! R4      R 4       tRtV tR# ))DeprecatedTests.test_inspect.<locals>.Clsi  rU  c                    R # rw   r.   r   s   &r*   re  .DeprecatedTests.test_inspect.<locals>.Cls.sync  r*  r5   c                   "   R # 5irw   r.   r   s   &r*   rh  .DeprecatedTests.test_inspect.<locals>.Cls.coro  s     rj  r.   N)	r0   r1   r2   r3   r   re  rh  r4   rH   r]   s   @r*   Clsrl    s5          r5   rq  N)r   r  inspectiscoroutinefunctionr  re  rh  )rB   re  rh  rq  s   &   r*   test_inspectDeprecatedTests.test_inspect  s    	F		 
	 
F		 
		 	 	44T:;33D9:44SXX>?33CHH=>r5   c           
     B    ! R  R4      p ! R R4      p ! R R4      p ! R R4      p ! R R	V4      p ! R
 RV4      p ! R RV4      p ! R RV4      p\        WW4WVWx34       F  p	V P                  RV	P                   R24      ;_uu_ 4         \        P                  ! V	4      p
 \        P                  ! V	P                  4      p\        R4      ! V	4      p \        P                  ! V4      pV P                  W4        \        P                  ! VP                  4      pV P                  W4       RRR4       K  	  R#   \
         d    Rp
 Li ; i  \
         d    Rp Li ; i  \
         d    Rp Li ; i  \
         d    Rp Lgi ; i  + '       g   i     EK:  ; i)c                       ] tR tRtRtR# ):DeprecatedTests.test_inspect_class_signature.<locals>.Cls1i  r.   Nr/   r.   r5   r*   Cls1rx    rT  r5   ry  c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ):DeprecatedTests.test_inspect_class_signature.<locals>.Cls2i  c                "   < \         SV `  V 4      # rw   r  r  r   yrC   s   &&&r*   r  BDeprecatedTests.test_inspect_class_signature.<locals>.Cls2.__new__      ws++r5   r.   r  rJ   s   @@r*   Cls2r{    s     , ,r5   r  c                   &   a  ] tR tRt o R tRtV tR# ):DeprecatedTests.test_inspect_class_signature.<locals>.Cls3i  c                    R # rw   r.   rB   r   r~  s   &&&r*   r  CDeprecatedTests.test_inspect_class_signature.<locals>.Cls3.__init__      r5   r.   Nr  r]   s   @r*   Cls3r    s      r5   r  c                   8   a a ] tR tRt oV 3R ltR tRtVtV ;t# ):DeprecatedTests.test_inspect_class_signature.<locals>.Cls4i  c                "   < \         SV `  V 4      # rw   r  r}  s   &&&r*   r  BDeprecatedTests.test_inspect_class_signature.<locals>.Cls4.__new__  r  r5   c                    R # rw   r.   r  s   &&&r*   r  CDeprecatedTests.test_inspect_class_signature.<locals>.Cls4.__init__  r  r5   r.   r  rJ   s   @@r*   Cls4r    s     , r5   r  c                       ] tR tRtRtR# ):DeprecatedTests.test_inspect_class_signature.<locals>.Cls5i  r.   Nr/   r.   r5   r*   Cls5r    rT  r5   r  c                       ] tR tRtRtR# ):DeprecatedTests.test_inspect_class_signature.<locals>.Cls6i  r.   Nr/   r.   r5   r*   Cls6r    rT  r5   r  c                       ] tR tRtRtR# ):DeprecatedTests.test_inspect_class_signature.<locals>.Cls7i  r.   Nr/   r.   r5   r*   Cls7r    rT  r5   r  c                       ] tR tRtRtR# ):DeprecatedTests.test_inspect_class_signature.<locals>.Cls8i  r.   Nr/   r.   r5   r*   Cls8r    rT  r5   r  zclass z
 signatureNrU  )	reversedr  r0   rr  	signaturer   r  r   r   )rB   ry  r  r  r  r  r  r  r  r  original_signatureoriginal_new_signaturedeprecated_clsdeprecated_signaturedeprecated_new_signatures   &              r*   test_inspect_class_signature,DeprecatedTests.test_inspect_class_signature  s   	 		, 	,	 		 		4 		4 		4 		4 	
 TTLMCs||nJ?@@.)0):):3)?&2-4->->s{{-K* ",F!3C!80+2+<+<^+L(   !3J4/6/@/@AWAW/X,   !7R- A@ N " .)-&. " 2-1*2 " 0+/(0 " 4/3,4) A@@s   FE ' EFE&/F E9!F E	FE	FE#	 F"E#	#F&E6	3F5E6	6F9F		FF			FFr.   N)r0   r1   r2   r3   rw  r}  r  r  r  r  r  r  r  r  r  r  r"  r-  r>  rD  rK  rR  ra  rt  r  r4   rH   r]   s   @r*   r\  r\    sv     F6	)($)*$") 1&& &(,",$*6?.8S 8Sr5   r\  c                  ~    \         P                  P                  4        \        P                  P                  4        R # rw   )rf   r  r   ra   r.   r5   r*   setUpModuler    s&    ""$!!#r5   r  )O
contextlibr   r  r  r  rr  ior   rg  r   rc  r  typingr   r   r9   r!  r   test.supportr   r	   r
   r   test.support.script_helperr   r   test.test_warnings.datar   r   r   r   r&   r   import_fresh_modulerf   _set_modulera   r+   r   r-   r7   rM   TestCaser_   rd   ri   r   r   r  r  r  r  r  r  r  r3  rN  rP  rj  r  r  r  r  r  r  r  r  r  r  r7  r9  r;  rX  rZ  r\  r  tearDownModuler0   mainr.   r5   r*   <module>r     sE   %  	    	 
   *   & " ( , N 2 ? $  //?    $..{N3
   z ". .<	' 	) )8-X -nh&7&7 ~x'8'8 n5( n5`	; 1 1 K!2!2 fB fBP	<H-- <9)X.. 9 >H  >F]H$5$5 1mX%6%6 1(~HXx00 ~HB=?8 =?@0(2C2C .+183D3D .+b[! [!z*H,=,= +X->-> TAx TAl 8(:K:K !98;L;L '!! '$>h 1 1 $>NKH%% K!-x(( !-HS" S"l*h// :x00 :( :z; 1 1 K!2!2 wS& wSt$
 zMMO r5   