+
    BisC                         ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt  ! R R]P                  4      t	 ! R R]P                  4      t
]R8X  d   ]P                  ! 4        R# R# )	    N)
gc_collect)productc                   >   a  ] tR t^	t o R tR tR tR tR tRt	V t
R# )Test_Assertionsc                   V P                  R R4       V P                  RR4       V P                  V P                  V P                   RR4       V P                  V P                  V P                  R R4       V P                  RR^ R7       V P                  V P                  V P                   RR^R7       V P                  ^ R^ R7       V P                  ^ R^R7       V P                  V P                  V P                   ^ R^R7       V P                  V P                  V P                  ^ R^ R7       V P                  \	        R4      \	        R4      4       V P                  V P                  V P                  \	        R4      \	        R4      4       R# )g1  ?      ?g  ?皙?)placesinfNy??)assertAlmostEqualassertNotAlmostEqualassertRaisesfailureExceptionfloatselfs   &9/usr/lib/python3.14/test/test_unittest/test_assertions.pytest_AlmostEqual Test_Assertions.test_AlmostEqual
   ss   z3/!!)S1$//00)S	B$//33Z	F 	sC2$//00#s1 	 	F 	q&3!!!VA!6$//00!VA 	 	G$//33Qq 	 	J 	uU|U5\:$//1J1J,e	6    c           	     v   V P                  R RRR7       V P                  RR RR7       V P                  R RRR7       V P                  RR RR7       V P                  RRRR7       V P                  V P                  V P                  RRRR7       V P                  V P                  V P                   R RRR7       V P                  V P                  V P                  R RRR7       V P                  \        V P                   R R^^R7       V P                  \        V P                  R R^^R7       \
        P
                  P                  4       pV\
        P                  ! ^
R7      ,           pV P                  W\
        P                  ! ^R7      R7       V P                  W\
        P                  ! ^R7      R7       R# )r	   r   g      ?)deltag?)r
   r   )secondsN)r   r   r   r   	TypeErrordatetimenow	timedelta)r   firstseconds   &  r   test_AmostEqualWithDelta(Test_Assertions.test_AmostEqualWithDelta!   s   sCs3sCs3!!#s$!7!!#s$!7sCs3$//1J1Js# 	 	/ 	$//1G1Gs$ 	 	0$//1J1Js# 	 	/ 	)T%;%;s1A 	 	7)T%>%>s1A 	 	7 !!%%'++B77u%-%7%7%C 	 	E!!%(0(:(:1(E 	" 	Gr   c                   R  pV P                  \        V\        4       V P                  \        V\        R4      4        V P                  \        R 4       V P                  R4        V P                  \        V\        4       V P                  R4       V P                  \        4      ;_uu_ 4       p \        h  T P                   d&   pT P	                  R\        T4      4        Rp?LRp?ii ; i  \         d     Lki ; i  \         d	   pTph Rp?ii ; i  + '       g   i     M; iT P                  XP                  X4       T P                  \        4      ;_uu_ 4        \        R4      h  + '       g   i     M; i T P                  \        4      ;_uu_ 4         RRR4       M  + '       g   i     M; iT P                  R4       M9  T P                   d&   pT P	                  R\        T4      4        Rp?MRp?ii ; i T P                  \        4      ;_uu_ 4        \        h  + '       g   i     M; i T P                  R4       R#   \         d     R# i ; i)c                     V hN )es   &r   _raise1Test_Assertions.test_assertRaises.<locals>._raise=   s    Gr   keyc                      R # r$   r%   r%   r   r   <lambda>3Test_Assertions.test_assertRaises.<locals>.<lambda>B   s    r   zassertRaises() didn't failzKeyError not raisedNz0assertRaises() didn't let exception pass through)
r   KeyErrorfailr   assertInstr
ValueError	ExceptionassertIs	exception)r   r'   r&   cmexcs   &    r   test_assertRaises!Test_Assertions.test_assertRaises<   s   	(FH5(FHUO<	4h5 II23	Jh
; IIHIx((B $$ 	9MM/Q88	9  		   )( 	bllC(x((5/! )(	4""8,, -,,,
 II23 $$ 	9MM/Q88	9	J""8,,   -,,
 IIHI  		s    B: )C3 2D4D:C0C++C03D DDDDDD*	&E22F	G #F.%	G .F>	9G H	$HH	I *H11I	<I I'&I'c                4  aa  ! R  R4      oRo ! VV3R lR\         P                  4      pV! R4      P                  4        \        4        V P	                  S! 4       4       V! R4      P                  4        \        4        V P	                  S! 4       4       R# )c                       ] tR t^itRtR# )<Test_Assertions.test_assertRaises_frames_survival.<locals>.Ar%   N)__name__
__module____qualname____firstlineno____static_attributes__r%   r   r   Ar;   i   s    r   rA   Nc                   <   <a  ] tR t^mt o VV3R ltR tR tRtV tR# )>Test_Assertions.test_assertRaises_frames_survival.<locals>.Fooc                v   < S! 4       p\         P                  ! V4      o \        h  \         d    \        hi ; ir$   )weakrefrefOSErrorr1   )r   arA   wrs   & r   fooBTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.fooo   s6    C[[^%!M %$$%s   & 8c                F    V P                  \        V P                  4       R # r$   r   r1   rJ   r   s   &r   test_functionalNTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.test_functionalx   s    !!*dhh7r   c                    V P                  \        4      ;_uu_ 4        V P                  4        R R R 4       R #   + '       g   i     R # ; ir$   rM   r   s   &r   	test_withHTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.test_with{   s+    &&z22HHJ 3222s	   9A
	r%   N)	r<   r=   r>   r?   rJ   rN   rQ   r@   __classdictcell__)__classdict__rA   rI   s   @r   FoorC   m   s     %8 r   rU   rN   rQ   )unittestTestCaserunr   assertIsNone)r   rU   rA   rI   s   & @@r   !test_assertRaises_frames_survival1Test_Assertions.test_assertRaises_frames_survivalf   sx    	 		 	(## 	$ 	""$"$K"$r   c                    V P                  R R4        V P                  R RR4       V P                  R4       R#   T P                   d/   pT P                  RTP                  ^ ,          4        Rp?R# Rp?ii ; i)zAla ma kotazr+zk.tMessagez"assertNotRegex should have failed.N)assertNotRegexr.   r   r/   args)r   r&   s   & r   testAssertNotRegex"Test_Assertions.testAssertNotRegex   si    M51	<vyA II:; $$ 	0MM)QVVAY//	0s   : A9#A44A9r%   N)r<   r=   r>   r?   r   r    r7   rZ   r`   r@   rS   rT   s   @r   r   r   	   s'     6.G6(JT @< <r   r   c                      a  ] tR t^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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$# )%TestLongMessagezTest that the individual asserts honour longMessage.
This actually tests all the message behaviour for
asserts that use longMessage.c                   a   ! V 3R  lR\         P                  4      p ! V 3R lR\         P                  4      pV! R4      S n        V! R4      S n        R# )c                   F   <a  ] tR t^t o Rt ZP
                  tR tRtV tR# )0TestLongMessage.setUp.<locals>.TestableTestFalseFc                    R # r$   r%   r   s   &r   testTest9TestLongMessage.setUp.<locals>.TestableTestFalse.testTest       r   r%   N	r<   r=   r>   r?   longMessager   ri   r@   rS   rT   r   s   @r   TestableTestFalserg      s      K#44 r   ro   c                   F   <a  ] tR t^t o Rt ZP
                  tR tRtV tR# )/TestLongMessage.setUp.<locals>.TestableTestTrueTc                    R # r$   r%   r   s   &r   ri   8TestLongMessage.setUp.<locals>.TestableTestTrue.testTest   rk   r   r%   Nrl   rn   s   @r   TestableTestTruerq      s      K#44 r   rt   ri   N)rV   rW   testableTruetestableFalse)r   ro   rt   s   f  r   setUpTestLongMessage.setUp   sC    	 1 1 		x00 	 -Z8.z:r   c                X    V P                  \        P                  P                  4       R # r$   )
assertTruerV   rW   rm   r   s   &r   testDefaultTestLongMessage.testDefault   s    ))556r   c                   V P                  V P                  P                  R R4      R4       V P                  V P                  P                  RR4      R4       V P                  V P                  P                  R R4      R4       V P                  V P                  P                  RR4      R4       V P                  P                  \	        4       R4       R # )NrJ   barz	bar : foo)assertEqualrv   _formatMessageru   objectr   s   &r   test_formatMsgTestLongMessage.test_formatMsg   s    ++::4GO++::5%H%P**99$FN**99%GU 	((59r   c                    R P                  R \        ^4       4       4      pV P                  P                  VR4       R# ) c              3   8   "   T F  p\        V4      x  K  	  R # 5ir$   )chr).0is   & r   	<genexpr>CTestLongMessage.test_formatMessage_unicode_error.<locals>.<genexpr>   s     1jc!ffjs   u   �N)joinrangeru   r   )r   ones   & r    test_formatMessage_unicode_error0TestLongMessage.test_formatMessage_unicode_error   s0    gg1eCj11((h7r   c                  a a VV 3R lp\        V4       FZ  w  rVV! V4      p/ pV^,          p	V	'       d   RR/pS P                  S P                  VR7      ;_uu_ 4        V! V/ VB  RRR4       K\  	  R#   + '       g   i     Kq  ; i)a'  
Check that methodName(*args) raises the correct error messages.
errors should be a list of 4 regex that match the error when:
  1) longMessage = False and no msg passed;
  2) longMessage = False and msg passed;
  3) longMessage = True and no msg passed;
  4) longMessage = True and msg passed;
c                 h   < V ^8  pV'       d   SP                   pMSP                  p\        VS4      # )   )rv   ru   getattr)r   useTestableFalsetest
methodNamer   s   &  r   	getMethod1TestLongMessage.assertMessages.<locals>.getMethod   s3     !A))((4,,r   msgoops)expected_regexN)	enumerateassertRaisesRegexr   )
r   r   r_   errorsr   r   r   
testMethodkwargswithMsgs
   ff&&      r   assertMessagesTestLongMessage.assertMessages   s    	- "+6!2A"1JF!eG''(=(=7E ( G GD+F+G G "3G G Gs   	A55Bc                0    V P                  R R. RO4       R# )rz   N)F)^False is not true$^oops$r   z^False is not true : oops$r   r   s   &r   testAssertTrueTestLongMessage.testAssertTrue   s    L(;	<r   c                0    V P                  R R. RO4       R# )assertFalseN)T)^True is not false$r   r   z^True is not false : oops$r   r   s   &r   testAssertFalseTestLongMessage.testAssertFalse   s    M7;	<r   c                0    V P                  R R. RO4       R# )assertNotEqualN   r   )^1 == 1$r   r   z^1 == 1 : oops$r   r   s   &r   testNotEqualTestLongMessage.testNotEqual   s    ,f0	1r   c                0    V P                  R R. RO4       R# )r   Nr   r   ))^1 != 2 within 7 places \(1 difference\)$r   r   z0^1 != 2 within 7 places \(1 difference\) : oops$r   r   s   &r   testAlmostEqualTestLongMessage.testAlmostEqual   s    B	Cr   c                0    V P                  R R. RO4       R# )r   Nr   )^1 == 1 within 7 places$r   r   z^1 == 1 within 7 places : oops$r   r   s   &r   testNotAlmostEqual"TestLongMessage.testNotAlmostEqual   s    2F\	]r   c                0    V P                  R R. RO4       R# )_baseAssertEqualNr   )^1 != 2$r   r   z^1 != 2 : oops$r   r   s   &r   test_baseAssertEqual$TestLongMessage.test_baseAssertEqual   s    .Q	Sr   c                6    V P                  R . R.3. RO4       R# )assertSequenceEqualN)\+ \[None\]$r   r   z\+ \[None\] : oops$r   r   s   &r   testAssertSequenceEqual'TestLongMessage.testAssertSequenceEqual   s"     	1B<5	6r   c                X    V P                  R \        4       \        R.4      3. RO4       R# )assertSetEqualN)None$r   r   zNone : oops$)r   setr   s   &r   testAssertSetEqual"TestLongMessage.testAssertSetEqual   s'    ,suc4&k.B-	.r   c                4    V P                  R R. 3. RO4       R# )r/   N)^None not found in \[\]$r   r   z^None not found in \[\] : oops$r   r   s   &r   testAssertInTestLongMessage.testAssertIn   s    Jr
A	Br   c                6    V P                  R RR.3. RO4       R# )assertNotInN)%^None unexpectedly found in \[None\]$r   r   z,^None unexpectedly found in \[None\] : oops$r   r   s   &r   testAssertNotInTestLongMessage.testAssertNotIn  s!    MD4&>N	Or   c                8    V P                  R / RR/3. RO4       R# )assertDictEqualr)   valueN)\+ \{'key': 'value'\}$r   r   z\+ \{'key': 'value'\} : oops$r   r   s   &r   testAssertDictEqual#TestLongMessage.testAssertDictEqual  s%    -UG4D/E?	@r   c                0    V P                  R R. RO4       R# )assertMultiLineEqualN)r   rJ   )	\+ foo\n$r   r   z\+ foo\n : oops$r   r   s   &r   testAssertMultiLineEqual(TestLongMessage.testAssertMultiLineEqual  s    2K2	3r   c                0    V P                  R R. RO4       R# )
assertLessNr   r   )^2 not less than 1$r   r   z^2 not less than 1 : oops$r   r   s   &r   testAssertLessTestLongMessage.testAssertLess  s    L&R	Sr   c                0    V P                  R R. RO4       R# )assertLessEqualNr   )^2 not less than or equal to 1$r   r   z&^2 not less than or equal to 1 : oops$r   r   s   &r   testAssertLessEqual#TestLongMessage.testAssertLessEqual  s    -vG	Hr   c                0    V P                  R R. RO4       R# )assertGreaterNr   )^1 not greater than 2$r   r   z^1 not greater than 2 : oops$r   r   s   &r   testAssertGreater!TestLongMessage.testAssertGreater#  s    OV>	?r   c                0    V P                  R R. RO4       R# )assertGreaterEqualNr   )"^1 not greater than or equal to 2$r   r   z)^1 not greater than or equal to 2 : oops$r   r   s   &r   testAssertGreaterEqual&TestLongMessage.testAssertGreaterEqual)  s    0&J	Kr   c                0    V P                  R R. RO4       R# )rY   N)znot None)^'not None' is not None$r   r   z^'not None' is not None : oops$r   r   s   &r   testAssertIsNone TestLongMessage.testAssertIsNone/  s    NM@	Ar   c                0    V P                  R R. RO4       R# )assertIsNotNoneNr$   )^unexpectedly None$r   r   z^unexpectedly None : oops$r   r   s   &r   testAssertIsNotNone#TestLongMessage.testAssertIsNotNone5  s    -w;	<r   c                0    V P                  R R. RO4       R# )r3   N)NrJ   )^None is not 'foo'$r   r  z^None is not 'foo' : oops$r   r   s   &r   testAssertIsTestLongMessage.testAssertIs;  s    J;	<r   c                0    V P                  R R. RO4       R# )assertIsNotN)NN)^unexpectedly identical: None$r   r  z%^unexpectedly identical: None : oops$r   r   s   &r   testAssertIsNotTestLongMessage.testAssertIsNotA  s    M<F	Gr   c                0    V P                  R R. RO4       R# )assertRegexN)rJ   r~   )^Regex didn't match:r   r  z!^Regex didn't match: (.*) : oops$r   r   s   &r   testAssertRegexTestLongMessage.testAssertRegexG  s    M>B	Cr   c                0    V P                  R R. RO4       R# )r^   N)rJ   rJ   )^Regex matched:r   r  z^Regex matched: (.*) : oops$r   r   s   &r   r`   "TestLongMessage.testAssertNotRegexN  s    ,n=	>r   c           
     ~   \        V P                  V P                  3/ RR/34      p\        WT4       F`  w  w  rgp\	        Wa4      p	V P                  VP                  V4      ;_uu_ 4        V	! V/ VB ;_uu_ 4       p
V! 4        RRR4       RRR4       Kb  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)aN  
Check that the correct error messages are raised while executing:
  with method(*args):
      func()
*errors* should be a list of 4 regex that match the error when:
  1) longMessage = False and no msg passed;
  2) longMessage = False and msg passed;
  3) longMessage = True and no msg passed;
  4) longMessage = True and msg passed;
r   r   N)r   rv   ru   zipr   r   r   )r   r   r_   funcr   pclsr   errmethodr5   s   &&&&&      r   assertMessagesCM TestLongMessage.assertMessagesCMV  s     T''):):;%)+"%a.MS3S-F''(<(<cBBT,V,,F - CB #1 -, CBBs$   )B+:BB+B(#B++B<c                >    V P                  R \        3R . RO4       R# )r   c                      R # r$   r%   r%   r   r   r+   2TestLongMessage.testAssertRaises.<locals>.<lambda>j  s    Dr   N^TypeError not raised$r   r   z^TypeError not raised : oops$r  r   r   s   &r   testAssertRaises TestLongMessage.testAssertRaisesi  s    nylL@	Ar   c                ~    V P                  R \        R3R . RO4       R pV P                  R \        R3V. RO4       R# )r   unused regexc                      R # r$   r%   r%   r   r   r+   7TestLongMessage.testAssertRaisesRegex.<locals>.<lambda>r      dr   c                      \        R 4      h)rJ   )r   r%   r   r   raise_wrong_messageBTestLongMessage.testAssertRaisesRegex.<locals>.raise_wrong_messagew  s    E""r   regexNr  ^"regex" does not match "foo"$r   r.  z%^"regex" does not match "foo" : oops$r!  r   r*  s   & r   testAssertRaisesRegex%TestLongMessage.testAssertRaisesRegexo  sK    1I~3N*@	A	#1Iw3G1H	Ir   c                >    V P                  R \        3R . RO4       R# )assertWarnsc                      R # r$   r%   r%   r   r   r+   1TestLongMessage.testAssertWarns.<locals>.<lambda>  s    Tr   N^UserWarning not triggered$r   r7  z"^UserWarning not triggered : oops$r  UserWarningr   s   &r   testAssertWarnsTestLongMessage.testAssertWarns  s    mk^\E	Fr   c                B    R  pV P                  R\        3V. RO4       R# )c                  @    \         P                  ! R \        ^R7       R# )xyz)
stacklevelN)warningswarnFutureWarningr%   r   r   warn_future8TestLongMessage.test_assertNotWarns.<locals>.warn_future  s    MM%1=r   _assertNotWarnsN)^FutureWarning triggered$r   rF  z ^FutureWarning triggered : oops$)r  rB  )r   rC  s   & r   test_assertNotWarns#TestLongMessage.test_assertNotWarns  s'    	>/-1A)C	Dr   c                ~    V P                  R \        R3R . RO4       R pV P                  R \        R3V. RO4       R# )assertWarnsRegexr%  c                      R # r$   r%   r%   r   r   r+   6TestLongMessage.testAssertWarnsRegex.<locals>.<lambda>  r(  r   c                  2    \         P                  ! R 4       R# )rJ   N)r@  rA  r%   r   r   r*  ATestLongMessage.testAssertWarnsRegex.<locals>.raise_wrong_message  s    MM% r   r,  Nr6  r-  r8  r/  s   & r   testAssertWarnsRegex$TestLongMessage.testAssertWarnsRegex  sK    0;2O*E	F	!0;2H1H	Ir   )rv   ru   N)(r<   r=   r>   r?   __doc__rw   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r  r`   r  r"  r0  r:  rG  rO  r@   rS   rb   s   @r   rd   rd      s     %;$7:8
,8<
<
1
C]
S6.
BO@3S
H?KA<<GC>&AI FDI Ir   rd   __main__)r   r@  rE   rV   test.supportr   	itertoolsr   rW   r   rd   r<   mainr%   r   r   <module>rV     s[        # D<h'' D<NMIh'' MI` zMMO r   