
    dafZ                        d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlZd dlm	Z	 d dl
mZmZmZ d Zd Z G d de      Zed	k7  red
z   nd dZd ZddZ G d d      Z G d d      Z G d d      Z G d d      Z G d dej4                        Z G d dej4                        Z G d dej4                        Z G d dej4                        Zed	k(  r ej>                          yy)    N)support)_Outcome)BufferedWriterLoggingResult#ResultWithNoStartTestRunStopTestRunc                  *    t        j                         S N)unittest
TestResult)_s    9/root/Python-3.12.4/Lib/test/test_unittest/test_runner.pyresultFactoryr      s          c                  \    t        j                  t        t        j                               S )N)resultclassstream)r
   TextTestRunnerr   ioStringIO r   r   	getRunnerr      s     ""}*,++-9 9r   c                       e Zd Zy)CustomErrorN__name__
__module____qualname__r   r   r   r   r          r   r   __main__. c                     t        j                         }| D ]2  }t         j                  j                  |      }|j	                  |       4 t               }t        j                         }|j                  |       |j                  t        j                                |j                  t        j                                |j                  |      S r	   )r
   	TestSuitedefaultTestLoaderloadTestsFromTestCaseaddTestsr   addTestrun)casessuitecasetestsrunner	realSuites         r   runTestsr/   "   s     E **@@Fu [F ""$Ie	MM($$&'h((*+::i  r   c                 b    |s| j                  d       y | j                  d       t        d      )Ncleanup_goodcleanup_exc
CleanUpExcappendr   )orderingblowUps     r   cleanupr8   3   s(    '&,''r   c                        e Zd ZddZd Zd Zy)TestCMNc                      || _         || _        y r	   )r6   enter_result)selfr6   r<   s      r   __init__zTestCM.__init__<   s     (r   c                 P    | j                   j                  d       | j                  S )Nenter)r6   r5   r<   r=   s    r   	__enter__zTestCM.__enter__@   s     W%   r   c                 :    | j                   j                  d       y )Nexit)r6   r5   r=   exc_infos     r   __exit__zTestCM.__exit__D   s    V$r   r	   )r   r   r   r>   rB   rG   r   r   r   r:   r:   ;   s    )!%r   r:   c                       e Zd Zy)LacksEnterAndExitNr   r   r   r   rI   rI   H   r   r   rI   c                       e Zd Zd Zy)
LacksEnterc                      y r	   r   rE   s     r   rG   zLacksEnter.__exit__K       r   N)r   r   r   rG   r   r   r   rK   rK   J       r   rK   c                       e Zd Zd Zy)	LacksExitc                      y r	   r   rA   s    r   rB   zLacksExit.__enter__N   rM   r   N)r   r   r   rB   r   r   r   rP   rP   M   rN   r   rP   c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)TestCleanUpc           
          G d dt         j                        } |d      }| j                  |j                  g        g fd}fd}|j	                  |dddd	d
       |j	                  |       | j                  |j                  |dt        d	d
      f|di fg       | j                  |j                                | j                  ddi fddt        d	d
      fg       y )Nc                       e Zd Zd Zy)-TestCleanUp.testCleanUp.<locals>.TestableTestc                      y r	   r   rA   s    r   testNothingz9TestCleanUp.testCleanUp.<locals>.TestableTest.testNothingU       r   Nr   r   r   rX   r   r   r   TestableTestrV   T       r   r[   rX   c                  .    j                  d| |f       y N   r5   argskwargscleanupss     r   cleanup1z)TestCleanUp.testCleanUp.<locals>.cleanup1]       OOQf-.r   c                  .    j                  d| |f       y )N   r`   ra   s     r   cleanup2z)TestCleanUp.testCleanUp.<locals>.cleanup2`   rf   r   r_   rh      hellogoodbyefourfiver_   rh   rj   r   )r
   TestCaseassertEqual	_cleanups
addCleanupdict
assertTrue
doCleanups)r=   r[   testre   ri   rd   s        @r   testCleanUpzTestCleanUp.testCleanUpS   s    	8,, 	 M*,	/	/ 	!QiH!#Y'	0RS#R,.	/ 	)*QBK!Y'Xa@b1c#der   c                   
  G d dt         j                        } |d      }t        j                         }t        |      x}|_        t        d      
t        d      
fd}fd}|j                  |       |j                  |       | j                  |j                                | j                  |j                         |j                  \  \  }}\  }}	| j                  d	|	       | j                  d
|	       | j                  t         d|	       | j                  d|       | j                  d|       | j                  t         d|       y )Nc                       e Zd Zd Zy)7TestCleanUp.testCleanUpWithErrors.<locals>.TestableTestc                      y r	   r   rA   s    r   rX   zCTestCleanUp.testCleanUpWithErrors.<locals>.TestableTest.testNothingo   rY   r   NrZ   r   r   r   r[   r|   n   r\   r   r[   rX   resultfoobarc                       r	   r   )r3   s   r   re   z3TestCleanUp.testCleanUpWithErrors.<locals>.cleanup1x   s	    r   c                       r	   r   )exc2s   r   ri   z3TestCleanUp.testCleanUpWithErrors.<locals>.cleanup2{   s    Jr   zin cleanup1zraise CleanUpExcz: foozin cleanup2z
raise exc2z: bar)r
   rq   r   r   _outcomer   rt   assertFalserw   successerrorsassertInCustomErrorRepr)r=   r[   rx   r   outcomere   ri   r   msg2msg1r3   r   s             @@r   testCleanUpWithErrorsz!TestCleanUp.testCleanUpWithErrorsm   s   	8,, 	 M*$$&"*&"99$- '
5!		 	!!*+)%}}	D9AtmT*($/)/6mT*lD))/6r   c                    	 dg  G 	fddt         j                        } |d      	fd}fdfd	j                  |        	fd}t        j                         }||_        	j                  |        j                  g d	       d
g  |d      		j                  |       	j                  |        j                  g d       y )NFc                   6    e Zd Z fdZfdZfdZy)2TestCleanUp.testCleanupInRun.<locals>.TestableTestc                 d    j                  d       j                         rt        d      y )NsetUpr   )r5   rt   r   )r=   r7   ri   r6   rx   s    r   r   z8TestCleanUp.testCleanupInRun.<locals>.TestableTest.setUp   s.    ()%e,, r   c                 J    j                  d       j                         y Nrx   r5   rt   )r=   cleanup3r6   rx   s    r   rX   z>TestCleanUp.testCleanupInRun.<locals>.TestableTest.testNothing       ')r   c                 (    j                  d       y NtearDownr`   r=   r6   s    r   r   z;TestCleanUp.testCleanupInRun.<locals>.TestableTest.tearDown       
+r   Nr   r   r   r   rX   r   )r7   ri   r   r6   rx   s   r   r[   r      s    -*,r   r[   rX   c                  (     j                  d       y Nre   r`   r6   s   r   re   z.TestCleanUp.testCleanupInRun.<locals>.cleanup1       OOJ'r   c                  (     j                  d       y Nri   r`   r   s   r   ri   z.TestCleanUp.testCleanupInRun.<locals>.cleanup2   r   r   c                  (     j                  d       y Nr   r`   r   s   r   r   z.TestCleanUp.testCleanupInRun.<locals>.cleanup3   r   r   c                 L    j                  |        j                  d       y )Nr   )rr   r5   )	some_testr6   r=   rx   s    r   r   z-TestCleanUp.testCleanupInRun.<locals>.success   s    Y-OOI&r   )r   rx   r   r   ri   re   r   T)r   ri   re   )r
   rq   rt   r   
addSuccessr(   rr   )
r=   r[   re   r   r   r7   ri   r   r6   rx   s
   `    @@@@@r   testCleanupInRunzTestCleanUp.testCleanupInRun   s    	, 	,8,, 	, M*	(	(	(!	' $$&# $G 	H M*!#DEr   c                     g  G fddt         j                        } |d      fdfdfdfdj                          | j                  g d       y )	Nc                   4    e Zd Z fdZfdZfdZy)CTestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.TestableTestc                 J    j                  d       | j                         y Nr   r   )r=   re   r6   s    r   r   zITestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.TestableTest.setUp       ()r   c                 J    j                  d       | j                         y r   r   r=   r   r6   s    r   rX   zOTestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.TestableTest.testNothing   r   r   c                 J    j                  d       j                         y r   r   )r=   cleanup4r6   rx   s    r   r   zLTestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.TestableTest.tearDown   s    
+)r   Nr   )re   r   r   r6   rx   s   r   r[   r      s    ***r   r[   rX   c                  J    j                  d       j                          y r   r   )ri   r6   rx   s   r   re   z?TestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.cleanup1   s    OOJ'OOH%r   c                  (     j                  d       y r   r`   r   s   r   ri   z?TestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.cleanup2   r   r   c                  (     j                  d       y r   r`   r   s   r   r   z?TestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.cleanup3   r   r   c                  (     j                  d       y )Nr   r`   r   s   r   r   z?TestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.cleanup4   r   r   )r   rx   r   r   r   re   ri   )r
   rq   debugrr   )r=   r[   re   ri   r   r   r6   rx   s     @@@@@@r   !testTestCaseDebugExecutesCleanupsz-TestCleanUp.testTestCaseDebugExecutesCleanups   sa    	* 	*8,, 	* M*	&	(	(	( 	

 $H 	Ir   c                 z    G d dt         j                        } |d      }g }|j                  |j                  d       t	        |d      }| j                  |j                  |      d       |j                  |j                  d       | j                  |j                                | j                  |g d       y )Nc                       e Zd Zd Zy)3TestCleanUp.test_enterContext.<locals>.TestableTestc                      y r	   r   rA   s    r   rX   z?TestCleanUp.test_enterContext.<locals>.TestableTest.testNothing   rY   r   NrZ   r   r   r   r[   r      r\   r   r[   rX   re   *   ri   r@   ri   rD   re   )	r
   rq   rt   r5   r:   rr   enterContextrv   rw   )r=   r[   rx   rd   cms        r   test_enterContextzTestCleanUp.test_enterContext   s    	8,, 	 M*4Hb!**2.34)*#LMr   c                     G d dt         j                        } |d      }| j                  t        d      5  |j	                  t                      d d d        | j                  t        d      5  |j	                  t                      d d d        | j                  t        d      5  |j	                  t                      d d d        | j                  |j                  g        y # 1 sw Y   xY w# 1 sw Y   jxY w# 1 sw Y   >xY w)Nc                       e Zd Zd Zy)>TestCleanUp.test_enterContext_arg_errors.<locals>.TestableTestc                      y r	   r   rA   s    r   rX   zJTestCleanUp.test_enterContext_arg_errors.<locals>.TestableTest.testNothing   rY   r   NrZ   r   r   r   r[   r      r\   r   r[   rX   the context manager)
r
   rq   assertRaisesRegex	TypeErrorr   rI   rK   rP   rr   rs   )r=   r[   rx   s      r   test_enterContext_arg_errorsz(TestCleanUp.test_enterContext_arg_errors   s    	8,, 	 M*##I/DE 	3/12	3##I/DE 	,jl+	,##I/DE 	+ik*	+ 	,	3 	3	, 	,	+ 	+s#   C'0C3(C?'C03C<?DN)	r   r   r   ry   r   r   r   r   r   r   r   r   rS   rS   R   s&    f47>,F\IBN -r   rS   c                   `    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zy)TestClassCleanupc           
          G d dt         j                        } |d      }| j                  |j                  g        g fd}fd}|j	                  |dddd	d
       |j	                  |       | j                  |j                  |dt        d	d
      f|di fg       |j                          | j                  ddi fddt        d	d
      fg       y )Nc                       e Zd Zd Zy);TestClassCleanup.test_addClassCleanUp.<locals>.TestableTestc                      y r	   r   rA   s    r   rX   zGTestClassCleanup.test_addClassCleanUp.<locals>.TestableTest.testNothing   rY   r   NrZ   r   r   r   r[   r      r\   r   r[   rX   c                  .    j                  d| |f       y Nrj   r`   rb   rc   class_cleanupss     r   class_cleanup1z=TestClassCleanup.test_addClassCleanUp.<locals>.class_cleanup1      !!1dF"34r   c                  .    j                  d| |f       y N   r`   r   s     r   class_cleanup2z=TestClassCleanup.test_addClassCleanUp.<locals>.class_cleanup2  r   r   r_   rh   rj   rk   rl   rm   rp   r   r   )r
   rq   rr   _class_cleanupsaddClassCleanupru   doClassCleanups)r=   r[   rx   r   r   r   s        @r   test_addClassCleanUpz%TestClassCleanup.test_addClassCleanUp   s    	8,, 	 M*--r2	5	5 	$$^Q1*1	 	% 	C$$^4--)9W9=?)2r24	5
 	$$&1b"+9*.G)*L8N *O 	Pr   c                     g d G fddt         j                        }t        |       | j                  ddg       g dt        |       | j                  g d       y )NTc                   B    e Zd Ze fd       ZfdZefd       Zy)=TestClassCleanup.test_run_class_cleanUp.<locals>.TestableTestc                 l    j                  d       | j                  t               r
t               y N
setUpClassr5   r   r8   r   clsr7   r6   s    r   r   zHTestClassCleanup.test_run_class_cleanUp.<locals>.TestableTest.setUpClass  /    -##GX6%-' r   c                 (    j                  d       y r   r`   r   s    r   rX   zITestClassCleanup.test_run_class_cleanUp.<locals>.TestableTest.testNothing#      'r   c                 (    j                  d       y NtearDownClassr`   r   r6   s    r   r   zKTestClassCleanup.test_run_class_cleanUp.<locals>.TestableTest.tearDownClass%      0r   Nr   r   r   classmethodr   rX   r   r7   r6   s   r   r[   r     s,    ( (
(1 1r   r[   r   r1   Fr   rx   r   r1   r
   rq   r/   rr   r=   r[   r7   r6   s     @@r   test_run_class_cleanUpz'TestClassCleanup.test_run_class_cleanUp  sd    	18,, 	1 	L.#ABP	Rr   c                     g d G fddt         j                        }t        |       | j                  ddg       g dt        |       | j                  g d       y )NTc                   H    e Zd Ze fd       ZfdZeed               Zy)STestClassCleanup.test_run_class_cleanUp_without_tearDownClass.<locals>.TestableTestc                 l    j                  d       | j                  t               r
t               y r   r   r   s    r   r   z^TestClassCleanup.test_run_class_cleanUp_without_tearDownClass.<locals>.TestableTest.setUpClass7  r   r   c                 (    j                  d       y r   r`   r   s    r   rX   z_TestClassCleanup.test_run_class_cleanUp_without_tearDownClass.<locals>.TestableTest.testNothing=  r   r   c                     t         r	   )AttributeError)r   s    r   r   zaTestClassCleanup.test_run_class_cleanUp_without_tearDownClass.<locals>.TestableTest.tearDownClass?  s
     %$r   N)r   r   r   r   r   rX   propertyr   r   s   r   r[   r   6  s4    ( (
(%  %r   r[   r   r1   F)r   rx   r1   r   r   s     @@r   ,test_run_class_cleanUp_without_tearDownClassz=TestClassCleanup.test_run_class_cleanUp_without_tearDownClass2  sd    	%8,, 	% 	L.#AB?	Ar   c                    g d G fddt         j                        }t         j                  j                  |      }|j	                          | j                  g d       g dt         j                  j                  |      }| j                  t              5 }|j	                          d d d        | j                  t        j                        d       | j                  g d       y # 1 sw Y   CxY w)NFc                   B    e Zd Ze fd       ZfdZefd       Zy)GTestClassCleanup.test_debug_executes_classCleanUp.<locals>.TestableTestc                 X    j                  d       | j                  t               y Nr   r7   r5   r   r8   r   s    r   r   zRTestClassCleanup.test_debug_executes_classCleanUp.<locals>.TestableTest.setUpClassR  $    -##GXf#Er   c                 (    j                  d       y r   r`   r   s    r   rX   zSTestClassCleanup.test_debug_executes_classCleanUp.<locals>.TestableTest.testNothingV  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zUTestClassCleanup.test_debug_executes_classCleanUp.<locals>.TestableTest.tearDownClassX  r   r   Nr   r   s   r   r[   r  Q  s.    F F(1 1r   r[   r   Tr3   )r   rx   r   r2   )
r
   rq   r$   r%   r   rr   assertRaisesr   str	exceptionr=   r[   r*   r   r7   r6   s       @@r    test_debug_executes_classCleanUpz1TestClassCleanup.test_debug_executes_classCleanUpM  s    		18,, 		1 **@@NP	R **@@N{+ 	rKKM	R\\*L9O	Q	 	s   C11C:c                 n   g d G fddt         j                        }t         j                  j                  |      }| j	                  t
              5 }|j                          d d d        | j                  t        j                        d       | j                  g d       | j                  |j                         |j                  j                          g dt         j                  j                  |      }| j	                  t
              5 }|j                          d d d        | j                  t        |j                        d       | j                  g d       | j                  |j                         |j                  j                          y # 1 sw Y   8xY w# 1 sw Y   xY w)NFc                   B    e Zd Ze fd       ZfdZefd       Zy)_TestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exception.<locals>.TestableTestc                 X    j                  d       | j                  t               y r  r  r   s    r   r   zjTestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exception.<locals>.TestableTest.setUpClasso  r  r   c                 (    j                  d       y r   r`   r   s    r   rX   zkTestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exception.<locals>.TestableTest.testNothings  r   r   c                 <    j                  d       t        d      )Nr   TearDownClassExcr4   r   s    r   r   zmTestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exception.<locals>.TestableTest.tearDownClassu  s    0!"455r   Nr   r   s   r   r[   r  n  s.    F F(6 6r   r[   r  )r   rx   r   T)r
   rq   r$   r%   r  r   r   rr   r  r  rv   r   clearr  s       @@r   8test_debug_executes_classCleanUp_when_teardown_exceptionzITestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exceptionj  sQ   
	68,, 
	6 **@@N{+ 	rKKM	R\\*,>?#JK445$$**,**@@N{+ 	rKKM	R\\*,>?#JK445$$**,	 		 	s   FF+F(+F4c                     G d dt         j                        }d }d }|j                  |       |j                  |       |j                          | j	                  t        |j                        d       |j                  \  }}| j                  |d   t               | j	                  t        |d         d       | j                  |d   t               | j	                  t        |d         d       y )	Nc                       e Zd Zd Zy)WTestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp.<locals>.TestableTestc                      y r	   r   rA   s    r   rX   zcTestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp.<locals>.TestableTest.testNothing  rY   r   NrZ   r   r   r   r[   r    r\   r   r[   c                      t        d      r   r   r   r   r   re   zSTestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp.<locals>.cleanup1      j))r   c                      t        d      r   r  r   r   r   ri   zSTestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp.<locals>.cleanup2  r  r   rh   r_   ri   re   )
r
   rq   r   r   rr   lentearDown_exceptionsassertIsInstancer   r  )r=   r[   re   ri   e1e2s         r   0test_doClassCleanups_with_errors_addClassCleanUpzATestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp  s    	8,, 		*	* 	$$X.$$X.$$&\==>B11Bbe[1RUZ0be[1RUZ0r   c                     g  G fddt         j                        }t        |      }| j                  |j                  d   d   j                         d   t         d       | j                  g d       y )Nc                   F    e Zd Ze fd       Z fdZd Ze fd       Zy)BTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTestc                 T    j                  d       | j                  t               y r   r  r   s    r   r   zMTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTest.setUpClass      -##GX6r   c                 X    j                  d       | j                  t        d       y Nr   Tr  r5   rt   r8   r   s    r   r   zHTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTest.setUp  !    ($?r   c                      y r	   r   rA   s    r   rX   zNTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTest.testNothing  rY   r   c                 (    j                  d       y r   r`   r   s    r   r   zPTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTest.tearDownClass  r   r   Nr   r   r   r   r   r   rX   r   r   s   r   r[   r)    s2    7 7@1 1r   r[   r   r_   : CleanUpExc)r   r   r2   r   r1   r
   rq   r/   rr   r   
splitlinesr   r=   r[   r   r6   s      @r   test_with_errors_addCleanUpz,TestClassCleanup.test_with_errors_addCleanUp  sr    	18,, 	1 ,'q)!,779"=+,L9	;;	<r   c                     g  G fddt         j                        }t        |      }| j                  |j                  d   d   j                         d   t         d       | j                  g d       y )Nc                   J    e Zd Ze fd       Z fdZ fdZe fd       Zy)KTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTestc                 X    j                  d       | j                  t        d       y Nr   Tr  r  r   s    r   r   zVTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTest.setUpClass  $    -##GXd#Cr   c                 T    j                  d       | j                  t               y r   r.  r   s    r   r   zQTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTest.setUp  s    (2r   c                 (    j                  d       y r   r`   r   s    r   rX   zWTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zYTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTest.tearDownClass  r   r   Nr2  r   s   r   r[   r;    s3    D D3(1 1r   r[   r   r_   r3  r4  )r   r   rx   r1   r   r2   r5  r7  s      @r   $test_run_with_errors_addClassCleanUpz5TestClassCleanup.test_run_with_errors_addClassCleanUp  sr    	18,, 	1 ,'q)!,779"=+,L9	;:	;r   c                 f   g dd G fddt         j                        }t        |      }| j                  |j                  d   d   j                         d   t         d       | j                  g d       g d	dt        |      }| j                  |j                  d   d   j                         d   t         d
       | j                  |j                  d   d   j                         d   t         d       | j                  ddg       g dd	t        |      }| j                  |j                  d   d   j                         d   t         d       | j                  |j                  d   d   j                         d   t         d       | j                  g d       y )NFc                   N    e Zd Ze fd       ZfdZfdZefd       Zy)UTestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTestc                 r    j                  d       | j                  t        d       rt        d      y )Nr   Tr  ClassExcr   r   class_blow_upr6   s    r   r   z`TestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTest.setUpClass  s7    -##GXd#C %j11 !r   c                 B    j                  d       rt        d      y Nr   	MethodExcr4   r=   method_blow_upr6   s    r   r   z[TestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTest.setUp  "    (!%k22 "r   c                 (    j                  d       y r   r`   r   s    r   rX   zaTestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zcTestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTest.tearDownClass  r   r   Nr2  rI  rN  r6   s   r   r[   rE    s1    2 2
3(1 1r   r[   r   r_   r3  r4  )r   r   rx   r   r2   T
: ClassExcr   r2   : MethodExc)r   r   r   r2   r5  )r=   r[   r   rI  rN  r6   s      @@@r   .test_with_errors_in_addClassCleanup_and_setUpsz?TestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps  s   	1 	18,, 	1" ,'q)!,779"=+,L9	;:	; ,'q)!,779"=+,J7	9q)!,779"=+,L9	;&6	8 ,'q)!,779"=+,K8	:q)!,779"=+,L9	;)	*r   c                     g  G fddt         j                        }t        |      }| j                  |j                  d   d   j                         d   t         d       | j                  g d       y )Nc                   @    e Zd Ze fd       Z fdZe fd       Zy)HTestClassCleanup.test_with_errors_in_tearDownClass.<locals>.TestableTestc                 T    j                  d       | j                  t               y r   r  r   s    r   r   zSTestClassCleanup.test_with_errors_in_tearDownClass.<locals>.TestableTest.setUpClass  r+  r   c                 (    j                  d       y r   r`   r   s    r   rX   zTTestClassCleanup.test_with_errors_in_tearDownClass.<locals>.TestableTest.testNothing  r   r   c                 <    j                  d       t        d      )Nr   TearDownExcr4   r   s    r   r   zVTestClassCleanup.test_with_errors_in_tearDownClass.<locals>.TestableTest.tearDownClass  s    0!-00r   Nr   r   s   r   r[   rX    s,    7 7(1 1r   r[   r   r_   r3  z: TearDownExcr   r5  r7  s      @r   !test_with_errors_in_tearDownClassz2TestClassCleanup.test_with_errors_in_tearDownClass  sq    
	18,, 
	1 ,'q)!,779"=+,M:	<P	Rr   c                 L    G d dt         j                        }g }|j                  |j                  d       t	        |d      }| j                  |j                  |      d       |j                  |j                  d       |j                          | j                  |g d       y )Nc                       e Zd Zd Zy)=TestClassCleanup.test_enterClassContext.<locals>.TestableTestc                      y r	   r   rA   s    r   rX   zITestClassCleanup.test_enterClassContext.<locals>.TestableTest.testNothing  rY   r   NrZ   r   r   r   r[   r`    r\   r   r[   re   r   ri   r   )r
   rq   r   r5   r:   rr   enterClassContextr   )r=   r[   rd   r   s       r   test_enterClassContextz'TestClassCleanup.test_enterClassContext  s    	8,, 	 $$X__jAHb!77;R@$$X__jA$$&#LMr   c                     G d dt         j                        }| j                  t        d      5  |j	                  t                      d d d        | j                  t        d      5  |j	                  t                      d d d        | j                  t        d      5  |j	                  t                      d d d        | j                  |j                  g        y # 1 sw Y   xY w# 1 sw Y   jxY w# 1 sw Y   >xY w)Nc                       e Zd Zd Zy)HTestClassCleanup.test_enterClassContext_arg_errors.<locals>.TestableTestc                      y r	   r   rA   s    r   rX   zTTestClassCleanup.test_enterClassContext_arg_errors.<locals>.TestableTest.testNothing*  rY   r   NrZ   r   r   r   r[   rf  )  r\   r   r[   r   )
r
   rq   r   r   rb  rI   rK   rP   rr   r   r=   r[   s     r   !test_enterClassContext_arg_errorsz2TestClassCleanup.test_enterClassContext_arg_errors(  s    	8,, 	 ##I/DE 	@**+<+>?	@##I/DE 	9**:<8	9##I/DE 	8**9;7	8 	55r:	@ 	@	9 	9	8 	8s#   C(C+ C7C(+C47D c                     g  G fddt         j                         G fddt         j                        }t        |       | j                  g d       y )Nc                   ,    e Zd Ze fd       Z fdZy)8TestClassCleanup.test_run_nested_test.<locals>.InnerTestc                 `    j                  d       | j                  j                   d       y )Ninner setupinner cleanupr5   r   r   s    r   r   zCTestClassCleanup.test_run_nested_test.<locals>.InnerTest.setUpClass:  #    .##HOO_Er   c                 (    j                  d       y )N
inner testr`   r   s    r   rx   z=TestClassCleanup.test_run_nested_test.<locals>.InnerTest.test>  s    -r   Nr   r   r   r   r   rx   r   s   r   	InnerTestrl  9  s    F F.r   ru  c                   .    e Zd Zefd       Z fdZy)8TestClassCleanup.test_run_nested_test.<locals>.OuterTestc                 `    j                  d       | j                  j                   d       y )Nouter setupouter cleanuprp  r   s    r   r   zCTestClassCleanup.test_run_nested_test.<locals>.OuterTest.setUpClassB  rq  r   c                 `    j                  d       t               j                  d       y )Nstart outer testend outer test)r5   r/   )r=   ru  r6   s    r   rx   z=TestClassCleanup.test_run_nested_test.<locals>.OuterTest.testF  s%     23# 01r   Nrt  )ru  r6   s   r   	OuterTestrw  A  s    F F2r   r~  )ry  r|  rn  rs  ro  r}  rz  r   )r=   r~  ru  r6   s     @@r   test_run_nested_testz%TestClassCleanup.test_run_nested_test6  sK    	.)) 	.	2)) 	2 	 $3 	4r   c                      G d dt         j                        }t         j                  j                  |      }t	               }|j                  |       | j                  d|j                  j                                y )Nc                       e Zd Zy)FTestClassCleanup.test_run_empty_suite_error_message.<locals>.EmptyTestNr   r   r   r   	EmptyTestr  R      r   r  z
NO TESTS RAN
)	r
   rq   r$   r%   r   r(   r   r   getvalue)r=   r  r*   r-   s       r   "test_run_empty_suite_error_messagez3TestClassCleanup.test_run_empty_suite_error_messageQ  s[    	)) 	 **@@K

5(&--*@*@*BCr   N)r   r   r   r   r   r   r  r  r&  r8  rB  rU  r]  rc  ri  r  r  r   r   r   r   r      sQ    P6R4A6Q: -D1.<.;.2*hR(N;46Dr   r   c                   r    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zy)TestModuleCleanUpc           
         g fdfd G fddt               }| j                  t        j                  j                  dt        dd      fd	i fg       t        j                  j                          | j                  d
d	i fddt        dd      fg       | j                  t        j                  j                  g        y )Nc                  .    j                  d| |f       y r   r`   rb   rc   module_cleanupss     r   module_cleanup1zHTestModuleCleanUp.test_add_and_do_ModuleCleanup.<locals>.module_cleanup1`      ""AtV#45r   c                  .    j                  d| |f       y r   r`   r  s     r   module_cleanup2zHTestModuleCleanUp.test_add_and_do_ModuleCleanup.<locals>.module_cleanup2c  r  r   c                   f    e Zd Z ej                  W  ddddd        ej                  W        y)?TestModuleCleanUp.test_add_and_do_ModuleCleanup.<locals>.Moduler_   rh   rj   rk   rl   rm   Nr   r   r   r
   addModuleCleanup)r  r  s   r   Moduler  f  s1    %H%%oq!Q+2D%H%%o6r   r  rp   rk   rl   rm   r   r   rj   )objectrr   r
   r+   _module_cleanupsru   doModuleCleanups)r=   r  r  r  r  s     @@@r   test_add_and_do_ModuleCleanupz/TestModuleCleanUp.test_add_and_do_ModuleCleanup]  s    	6	6	7V 	7
 	77*IW9=?*B35	6
 	&&(Ar2;I*.G)*L9N +O 	P77<r   c           	         g fdd  G fddt               }| j                  t        j                  j                  dt        dd      fd	i fg       | j                  t              5 }t        j                  j                          d d d        | j                  t        j                        d
       | j                  t        j                  j                  g        y # 1 sw Y   YxY w)Nc                  .    j                  d| |f       y r   r`   r  s     r   module_cleanup_goodzcTestModuleCleanUp.test_doModuleCleanup_with_errors_in_addModuleCleanup.<locals>.module_cleanup_goodx  r  r   c                      t        d      )Nr3   r  )rb   rc   s     r   module_cleanup_badzbTestModuleCleanUp.test_doModuleCleanup_with_errors_in_addModuleCleanup.<locals>.module_cleanup_bad{  s    l++r   c                   f    e Zd Z ej                  W ddddd        ej                  W         y)VTestModuleCleanUp.test_doModuleCleanup_with_errors_in_addModuleCleanup.<locals>.Moduler_   rh   rj   rk   rl   rm   Nr  )r  r  s   r   r  r  ~  s3    %H%%&91a+2D%H%%&89r   r  rp   rk   rl   rm   r   r3   )r  rr   r
   r+   r  ru   r  r   r  r  r  )r=   r  er  r  r  s      @@@r   4test_doModuleCleanup_with_errors_in_addModuleCleanupzFTestModuleCleanUp.test_doModuleCleanup_with_errors_in_addModuleCleanupu  s    	6	,	:V 	: 	77.	W9=?-r268	9 {+ 	-qMM**,	-Q[[)<877<	- 	-s   2C))C2c                      g fd G  fddt               }t        j                  j                           j	                  dddifg       y )Nc                  ,    j                  | |f       y r	   r`   ra   s     r   r8   zCTestModuleCleanUp.test_addModuleCleanup_arg_errors.<locals>.cleanup      OOT6N+r   c                   $   e Zd Z ej                  W  ddd       W j                  e      5   ej                  W  d       ddd       W j                  e      5   ej                          ddd       y# 1 sw Y   6xY w# 1 sw Y   yxY w)BTestModuleCleanUp.test_addModuleCleanup_arg_errors.<locals>.Moduler_   rh   rk   )functionr  argN)r   r   r   r
   r  r  r   r8   r=   s   r   r  r    s    %H%%gq!gF""9- I)))7HI""9- ,)))+, ,I I, ,s   A:B:BBr  r_   rh   r  rk   )r  r
   r+   r  rr   )r=   r  r8   rd   s   ` @@r    test_addModuleCleanup_arg_errorsz2TestModuleCleanUp.test_addModuleCleanup_arg_errors  sK    	,	,V 	, 	&&(!J#89:	<r   c                    dg  G fddt               } G fddt        j                        }d|_        |t        j
                  d<   t        |      }| j                  ddg       | j                  |j                  d   d	   j                         d
   t         d       g dt        |       | j                  g d       | j                  t        j                  j                  g        y )NTc                   8    e Zd Ze fd       Zefd       Zy)9TestModuleCleanUp.test_run_module_cleanUp.<locals>.Modulec                  v    j                  d       t        j                  t                rt	        d      y )NsetUpModulezsetUpModule Excr5   r
   r  r8   r   r   s   r   r  zETestModuleCleanUp.test_run_module_cleanUp.<locals>.Module.setUpModule  s3    .))'8<%&788 r   c                  (     j                  d       y NtearDownModuler`   r   s   r   r  zHTestModuleCleanUp.test_run_module_cleanUp.<locals>.Module.tearDownModule       01r   Nr   r   r   staticmethodr  r  r   s   r   r  r    s)    9 9
 2 2r   r  c                   @    e Zd Ze fd       Z fdZe fd       Zy)?TestModuleCleanUp.test_run_module_cleanUp.<locals>.TestableTestc                 (    j                  d       y r   r`   r   s    r   r   zJTestModuleCleanUp.test_run_module_cleanUp.<locals>.TestableTest.setUpClass      -r   c                 (    j                  d       y r   r`   r   s    r   rX   zKTestModuleCleanUp.test_run_module_cleanUp.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zMTestModuleCleanUp.test_run_module_cleanUp.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   r[   r    ,    . .(1 1r   r[   r  r1   r   r_   r3  z: setUpModule ExcFr  r   rx   r   r  r1   r  r
   rq   r   sysmodulesr/   rr   r   r6  r   r+   r  )r=   r  r[   r   r7   r6   s       @@r   test_run_module_cleanUpz)TestModuleCleanUp.test_run_module_cleanUp  s    		2V 		2	18,, 	1 #+ &H,'M>#BCq)!,779"=+,,=>	@ <	= 	77<r   c                 ^   ddg  G fddt               } G fddt               } G fddt        j                        } G fd	d
t        j                        }d|_        |t        j
                  d<   d|_        |t        j
                  d<   t        ||       | j                  g d       g ddt        ||       | j                  g d       g ddt        ||       | j                  g d       | j                  t        j                  j                  g        y )NTFc                   8    e Zd Ze fd       Zefd       Zy)CTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module1c                  t    j                  d       t        j                  t                r
t	               y Nr  r  r   s   r   r  zOTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module1.setUpModule  s/    .))'8<%-' r   c                  (     j                  d       y r  r`   r   s   r   r  zRTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module1.tearDownModule  r  r   Nr  r   s   r   Module1r    s)    ( (
 2 2r   r  c                   8    e Zd Ze fd       Zefd       Zy)CTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module2c                  t    j                  d       t        j                  t                r
t	               y )NsetUpModule2r  blowUp2r6   s   r   r  zOTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module2.setUpModule  s/    /))'8<%-' r   c                  (     j                  d       y )NtearDownModule2r`   r   s   r   r  zRTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module2.tearDownModule  s     12r   Nr  r  s   r   Module2r    s)    ( (
 3 3r   r  c                   @    e Zd Ze fd       Z fdZe fd       Zy)HTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTestc                 (    j                  d       y r   r`   r   s    r   r   zSTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest.setUpClass  r  r   c                 (    j                  d       y r   r`   r   s    r   rX   zTTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zVTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   r[   r    r  r   r[   c                   @    e Zd Ze fd       Z fdZe fd       Zy)ITestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest2c                 (    j                  d       y )NsetUpClass2r`   r   s    r   r   zTTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest2.setUpClass  s    .r   c                 (    j                  d       y Ntest2r`   r   s    r   rX   zUTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest2.testNothing      (r   c                 (    j                  d       y )NtearDownClass2r`   r   s    r   r   zWTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest2.tearDownClass  r  r   Nr   r   s   r   TestableTest2r    s,    / /)2 2r   r  )r  r1   r  r  r  r  r  r1   )r  r   rx   r   r  r1   r  r1   )r  r   rx   r   r  r1   r  r  r  r  r  r1   
r  r
   rq   r   r  r  r/   rr   r+   r  )r=   r  r  r[   r  r7   r  r6   s        @@@r    test_run_multiple_module_cleanUpz2TestModuleCleanUp.test_run_multiple_module_cleanUp  s   		2f 		2		3f 		3	18,, 	1	2H-- 	2 #,!(I#, !(I}- $4 	5 }- $4 	5
 }-=	>
 	77<r   c                 (   g  G fddt               } G fddt        j                        }d|_        |t        j
                  d<   t        |       | j                  g d       | j                  t        j                  j                  g        y )Nc                   "    e Zd Ze fd       Zy)JTestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.Modulec                  \     j                  d       t        j                  t                y r  r5   r
   r  r8   r   s   r   r  zVTestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.Module.setUpModule      .))'8<r   N)r   r   r   r  r  r   s   r   r  r    s    = =r   r  c                   @    e Zd Ze fd       Z fdZe fd       Zy)PTestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.TestableTestc                 (    j                  d       y r   r`   r   s    r   r   z[TestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.TestableTest.setUpClass  r  r   c                 (    j                  d       y r   r`   r   s    r   rX   z\TestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   z^TestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   r[   r    r  r   r[   )r  r   rx   r   r1   r  )r=   r  r[   r6   s      @r   (test_run_module_cleanUp_without_teardownz:TestModuleCleanUp.test_run_module_cleanUp_without_teardown  sw    	=V 	=	18,, 	1 #+ &H $E 	F77<r   c                    g  G fddt               } G fddt        j                        }d|_        |t        j
                  d<   t        |      }| j                  |j                  d   d   j                         d   t         d       | j                  g d	       | j                  t        j                  j                  g        y )
Nc                   6    e Zd Ze fd       Ze fd       Zy)QTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.Modulec                  \     j                  d       t        j                  t                y r  r  r   s   r   r  z]TestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.Module.setUpModule(  r  r   c                  <     j                  d       t        d      )Nr  r3   r4   r   s   r   r  z`TestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.Module.tearDownModule,  s     01!,//r   Nr  r   s   r   r  r  '  s)    = = 0 0r   r  c                   @    e Zd Ze fd       Z fdZe fd       Zy)WTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.TestableTestc                 (    j                  d       y r   r`   r   s    r   r   zbTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.TestableTest.setUpClass2  r  r   c                 (    j                  d       y r   r`   r   s    r   rX   zcTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.TestableTest.testNothing5  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zeTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.TestableTest.tearDownClass7  r   r   Nr   r   s   r   r[   r  1  r  r   r[   r   r_   r3  r4  r  r  r=   r  r[   r   r6   s       @r   /test_run_module_cleanUp_when_teardown_exceptionzATestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception%  s    	0V 	0	18,, 	1 #+ &H,'q)!,779"=+,L9	; $4 	5 	77<r   c                    g d G fddt               } G fddt        j                        }d|_        |t        j
                  d<   t        j                  j                  |      }|j                          | j                  g d       | j                  t        j                  j                  g        g dt        j                  j                  |      }| j                  t              5 }|j                          d d d        | j                  t        j                        d       | j                  g d	       | j                  t        j                  j                  g        y # 1 sw Y   mxY w)
NFc                   8    e Zd Ze fd       Zefd       Zy)DTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.Modulec                  `    j                  d       t        j                  t                y Nr  r  r  r   s   r   r  zPTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.Module.setUpModuleI  !    .))'8FKr   c                  (     j                  d       y r  r`   r   s   r   r  zSTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.Module.tearDownModuleM  r  r   Nr  r   s   r   r  r  H  s+    L L 2 2r   r  c                   @    e Zd Ze fd       Z fdZe fd       Zy)JTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.TestableTestc                 (    j                  d       y r   r`   r   s    r   r   zUTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.TestableTest.setUpClassR  r  r   c                 (    j                  d       y r   r`   r   s    r   rX   zVTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.TestableTest.testNothingU  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zXTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.TestableTest.tearDownClassW  r   r   Nr   r   s   r   r[   r  Q  r  r   r[   r  Tr3   )r  r   rx   r   r  r2   )r  r
   rq   r   r  r  r$   r%   r   rr   r+   r  r  r   r  r  r=   r  r[   r*   r   r7   r6   s        @@r   "test_debug_module_executes_cleanUpz4TestModuleCleanUp.test_debug_module_executes_cleanUpE  s+   	2V 	2	18,, 	1 #+ &H**@@N<	= 	77<**@@N{+ 	rKKM	R\\*L9 $V 	W77<	 	s   3E00E9c                 4   g d G fddt               } G fddt        j                        }d|_        |t        j
                  d<   t        j                  j                  |      }| j                  t              5 }|j                          d d d        | j                  t        j                        d       | j                  g d       | j                  t        j                  j                          t        j                  j                   j#                          g dt        j                  j                  |      }| j                  t              5 }|j                          d d d        | j                  t        |j                        d       | j                  g d       | j                  t        j                  j                          t        j                  j                   j#                          y # 1 sw Y   pxY w# 1 sw Y   xY w)	NFc                   8    e Zd Ze fd       Zefd       Zy)STestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.Modulec                  `    j                  d       t        j                  t                y r  r  r   s   r   r  z_TestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.Module.setUpModuler  r  r   c                  <     j                  d       t        d      )Nr  TearDownModuleExcr4   r   s   r   r  zbTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.Module.tearDownModulev  s     01!"566r   Nr  r   s   r   r  r  q  s+    L L 7 7r   r  c                   @    e Zd Ze fd       Z fdZe fd       Zy)YTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.TestableTestc                 (    j                  d       y r   r`   r   s    r   r   zdTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.TestableTest.setUpClass|  r  r   c                 (    j                  d       y r   r`   r   s    r   rX   zeTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zgTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   r[   r  {  r  r   r[   r  )r  r   rx   r   r  T)r  r
   rq   r   r  r  r$   r%   r  r   r   rr   r  r  rv   r+   r  r  r  s        @@r   1test_debug_module_cleanUp_when_teardown_exceptionzCTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exceptionn  s   	7V 	7	18,, 	1 #+ &H**@@N{+ 	rKKM	R\\*,?@ $G 	H667&&,,.**@@N{+ 	rKKM	R\\*,?@ $G 	H667&&,,.#	 		 	s   HHHHc                     g fd G  fddt         j                        } j                  t              5  |j	                          d d d         j                  t              5  t         j                  j                   |              d d d        t        |        j                  ddddfg       y # 1 sw Y   qxY w# 1 sw Y   9xY w)	Nc                  ,    j                  | |f       y r	   r`   ra   s     r   r8   zBTestModuleCleanUp.test_addClassCleanup_arg_errors.<locals>.cleanup  r  r   c                   *    e Zd Ze fd       Zd Zy)GTestModuleCleanUp.test_addClassCleanup_arg_errors.<locals>.TestableTestc                     | j                  dddd       j                  t              5  | j                  d       d d d        y # 1 sw Y   y xY w)Nr_   rh   rj   r   r  r   rk   r  )r   r  r   )r   r8   r=   s    r   r   zRTestModuleCleanUp.test_addClassCleanup_arg_errors.<locals>.TestableTest.setUpClass  sV    ##GQA1#E&&y1 G''g'FG G G   A

Ac                      y r	   r   rA   s    r   rX   zSTestModuleCleanUp.test_addClassCleanup_arg_errors.<locals>.TestableTest.testNothing  rY   r   N)r   r   r   r   r   rX   r  s   r   r[   r    s    G Gr   r[   )r   r  r  rj   r   r  )r
   rq   r  r   r   rt   r/   rr   r=   r[   r8   rd   s   ` @@r   test_addClassCleanup_arg_errorsz1TestModuleCleanUp.test_addClassCleanup_arg_errors  s    	,	8,, 	 y) 	+((*	+y) 	O((\^g(N	O!!#<=>	@	+ 	+	O 	Os   B=*'C	=C	Cc                     g fd G  fddt         j                        } j                  t              5   |       j	                          d d d         j                  t              5  t         j                  j	                   |              d d d        t        |        j                  ddddfg       y # 1 sw Y   qxY w# 1 sw Y   9xY w)	Nc                  ,    j                  | |f       y r	   r`   ra   s     r   r8   z=TestModuleCleanUp.test_addCleanup_arg_errors.<locals>.cleanup  r  r   c                        e Zd Z fdZd Zy)BTestModuleCleanUp.test_addCleanup_arg_errors.<locals>.TestableTestc                     | j                  dddd       j                  t              5  | j                  d       d d d        y # 1 sw Y   y xY w)Nr_   rh   rj   r   r  r=   rk   r  )rt   r  r   )self2r8   r=   s    r   r   zHTestModuleCleanUp.test_addCleanup_arg_errors.<locals>.TestableTest.setUp  sV      !Q C&&y1 D$$g7$CD D Dr   c                      y r	   r   rA   s    r   rX   zNTestModuleCleanUp.test_addCleanup_arg_errors.<locals>.TestableTest.testNothing  rY   r   N)r   r   r   r   rX   r  s   r   r[   r'    s    Dr   r[   )r=   r  r  rj   r   r)  )r
   rq   r  r   rt   r/   rr   r"  s   ` @@r   test_addCleanup_arg_errorsz,TestModuleCleanUp.test_addCleanup_arg_errors  s    	,	8,, 	 y) 	(N%%'	(y) 	P((lnw(O	P!1#=>?	A	( 	(	P 	Ps   C/'CCCc                 H   g  G fddt               } G fddt        j                        }d|_        |t        j
                  d<   t        |      }| j                  |j                  d   d   j                         d   t         d       | j                  g d	       y )
Nc                   6    e Zd Ze fd       Ze fd       Zy)ETestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.Modulec                  \     j                  d       t        j                  t                y r  r  r   s   r   r  zQTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.Module.setUpModule  r  r   c                  (     j                  d       y r  r`   r   s   r   r  zTTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.Module.tearDownModule  r  r   Nr  r   s   r   r  r/    )    = = 2 2r   r  c                   @    e Zd Ze fd       Z fdZe fd       Zy)KTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.TestableTestc                 X    j                  d       | j                  t        d       y r=  r  r   s    r   r   zVTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.TestableTest.setUpClass  r>  r   c                 (    j                  d       y r   r`   r   s    r   rX   zWTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zYTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   r[   r4    s.    D D(1 1r   r[   r   r_   r3  r4  )r  r   rx   r   r2   r  r1   r  r
   rq   r   r  r  r/   rr   r   r6  r   r  s       @r   #test_with_errors_in_addClassCleanupz5TestModuleCleanUp.test_with_errors_in_addClassCleanup  s    	2V 	2		18,, 		1 #+ &H,'q)!,779"=+,L9	;K	Lr   c                 H   g  G fddt               } G fddt        j                        }d|_        |t        j
                  d<   t        |      }| j                  |j                  d   d   j                         d   t         d       | j                  g d	       y )
Nc                   6    e Zd Ze fd       Ze fd       Zy)@TestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.Modulec                  \     j                  d       t        j                  t                y r  r  r   s   r   r  zLTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.Module.setUpModule  r  r   c                  (     j                  d       y r  r`   r   s   r   r  zOTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.Module.tearDownModule  r  r   Nr  r   s   r   r  r<    r2  r   r  c                   ,    e Zd Z fdZ fdZ fdZy)FTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.TestableTestc                 X    j                  d       | j                  t        d       y r-  r.  r   s    r   r   zLTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.TestableTest.setUp  r/  r   c                 (    j                  d       y r   r`   r   s    r   rX   zRTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zOTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.TestableTest.tearDown  r   r   Nr   r   s   r   r[   r@    s    @(,r   r[   r   r_   r3  r4  )r  r   rx   r   r2   r  r1   r8  r  s       @r   test_with_errors_in_addCleanupz0TestModuleCleanUp.test_with_errors_in_addCleanup  s    	2V 	2	,8,, 	, #+ &H,'q)!,779"=+,L9	;K	Lr   c                    g ddd G fddt               } G fddt        j                        }d|_        |t        j
                  d<   t        |      }| j                  |j                  d   d   j                         d   t         d	       | j                  g d
       g dddt        |      }| j                  |j                  d   d   j                         d   t         d       | j                  |j                  d   d   j                         d   t         d	       | j                  ddg       g dddt        |      }| j                  |j                  d   d   j                         d   t         d       | j                  |j                  d   d   j                         d   t         d	       | j                  g d       g dddt        |      }| j                  |j                  d   d   j                         d   t         d       | j                  |j                  d   d   j                         d   t         d	       | j                  g d       y )NFc                   8    e Zd Ze fd       Zefd       Zy)QTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.Modulec                  z    j                  d       t        j                  t        d        rt	        d      y )Nr  Tr  	ModuleExcr  module_blow_upr6   s   r   r  z]TestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.Module.setUpModule  s4    .))'8DI!%k22 "r   c                  (     j                  d       y r  r`   r   s   r   r  z`TestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.Module.tearDownModule  r  r   Nr  rJ  s   r   r  rG  
  s)    3 3
 2 2r   r  c                   N    e Zd Ze fd       ZfdZfdZefd       Zy)WTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTestc                 B    j                  d       rt        d      y )Nr   rG  r4   rH  s    r   r   zbTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTest.setUpClass  s"    - %j11 !r   c                 B    j                  d       rt        d      y rK  r4   rM  s    r   r   z]TestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTest.setUp  rO  r   c                 (    j                  d       y r   r`   r   s    r   rX   zcTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTest.testNothing  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zeTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTest.tearDownClass!  r   r   Nr2  rR  s   r   r[   rN    s1    2 23(1 1r   r[   r   r_   r3  r4  )r  r   r   rx   r   r  r2   Tz: ModuleExcr  r2   rS  )r  r   r  r2   rT  )r  r   r   r   r  r2   r8  )r=   r  r[   r   rI  rN  rK  r6   s       @@@@r   /test_with_errors_in_addModuleCleanup_and_setUpszATestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps  s   		2V 		2	1 	18,, 	1  #+ &H,'q)!,779"=+,L9	;)	*
 ,'q)!,779"=+,K8	:q)!,779"=+,L9	;M=#AB,'q)!,779"=+,J7	9q)!,779"=+,L9	; $E 	F ,'q)!,779"=+,K8	:q)!,779"=+,L9	; $3 	4r   c                 D   g fdfdfd G fddt               } G fddt        j                        } G fdd	t        j                        }d|_        d|_        |t        j
                  d<   t        ||       | j                  g d
       y )Nc                  (     j                  d       y r   r`   r   s   r   re   zMTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.cleanup1V  r   r   c                  (     j                  d       y r   r`   r   s   r   ri   zMTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.cleanup2Y  r   r   c                  (     j                  d       y r   r`   r   s   r   r   zMTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.cleanup3\  r   r   c                   8    e Zd Ze fd       Zefd       Zy)KTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.Modulec                  R    j                  d       t        j                          y r  )r5   r
   r  re   r6   s   r   r  zWTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.Module.setUpModule`  s    .))(3r   c                  (     j                  d       y r  r`   r   s   r   r  zZTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.Module.tearDownModuled  r  r   Nr  r[  s   r   r  rY  _  s)    4 4 2 2r   r  c                   .    e Zd Z fdZfdZfdZy)QTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.TestableTestc                 J    j                  d       | j                         y r   r   )r=   ri   r6   s    r   r   zWTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.TestableTest.setUpi  r   r   c                 (    j                  d       y r   r`   r   s    r   rX   z]TestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.TestableTest.testNothingl  r   r   c                 (    j                  d       y r   r`   r   s    r   r   zZTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.TestableTest.tearDownn  r   r   Nr   )ri   r6   s   r   r[   r^  h  s    *(,r   r[   c                   .    e Zd Z fdZfdZfdZy)VTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.OtherTestableTestc                 J    j                  d       | j                         y )NsetUp2r   r   s    r   r   z\TestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.OtherTestableTest.setUpr  s    ))r   c                 (    j                  d       y r  r`   r   s    r   rX   zbTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.OtherTestableTest.testNothingu  r  r   c                 (    j                  d       y )N	tearDown2r`   r   s    r   r   z_TestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.OtherTestableTest.tearDownw  s    ,r   Nr   )r   r6   s   r   OtherTestableTestrc  q  s    *)-r   ri  )r  r   rx   r   ri   re  r  rh  r   r  re   )r  r
   rq   r   r  r  r/   rr   )r=   r  r[   ri  re   ri   r   r6   s       @@@@r   )test_module_cleanUp_with_multiple_classesz;TestModuleCleanUp.test_module_cleanUp_with_multiple_classesT  s    	(	(	(	2V 	2	,8,, 	,	- 1 1 	- #+'/$ &H01D	Er   c                 N   g }t        j                  |j                  d       t        |d      }| j	                  t        j
                  |      d       t        j                  |j                  d       t         j                  j                          | j	                  |g d       y )Nre   r   ri   r   )r
   r  r5   r:   rr   enterModuleContextr+   r  )r=   rd   r   s      r   test_enterModuleContextz)TestModuleCleanUp.test_enterModuleContext  sw    !!(//:>Hb!44R8"=!!(//:>&&(#LMr   c                 :    G d dt         j                        }| j                  t        d      5  t        j                  t                      d d d        | j                  t        d      5  t        j                  t                      d d d        | j                  t        d      5  t        j                  t                      d d d        | j                  t         j                  j                  g        y # 1 sw Y   xY w# 1 sw Y   |xY w# 1 sw Y   LxY w)Nc                       e Zd Zd Zy)JTestModuleCleanUp.test_enterModuleContext_arg_errors.<locals>.TestableTestc                      y r	   r   rA   s    r   rX   zVTestModuleCleanUp.test_enterModuleContext_arg_errors.<locals>.TestableTest.testNothing  rY   r   NrZ   r   r   r   r[   rp    r\   r   r[   r   )r
   rq   r   r   rl  rI   rK   rP   rr   r+   r  rh  s     r   "test_enterModuleContext_arg_errorsz4TestModuleCleanUp.test_enterModuleContext_arg_errors  s    	8,, 	 ##I/DE 	=''(9(;<	=##I/DE 	6''
5	6##I/DE 	5''	4	5 	77<	= 	=	6 	6	5 	5s#   C9,D(D9DDDN)r   r   r   r  r  r  r  r  r  r  r  r  r#  r,  r9  rD  rS  rj  rm  rr  r   r   r   r  r  \  sg    =0=,<%=NI=V=2=@'=R+/Z@,A*LBL<M4^-E^	N=r   r  c                       e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Z ej                          d        Zd Zd Zd Zy)Test_TextTestRunnerzTests for TextTestRunner.c                     t         j                  j                  d      | _        | j                  rt         j                  d= y y NPYTHONWARNINGS)osenvirongetpythonwarningsrA   s    r   r   zTest_TextTestRunner.setUp  s5     !jjnn-=>

+, r   c                 X    | j                   r| j                   t        j                  d<   y y rv  )r{  rx  ry  rA   s    r   r   zTest_TextTestRunner.tearDown  s%    +/+>+>BJJ'( r   c                    t        j                         }| j                  |j                         | j                  |j                         | j                  |j                  d       | j                  |j                  d        | j                  |j                         | j                  |j                  t         j                         | j                  |j                         | j                  |j                         y r^   )r
   r   r   failfastbufferrr   	verbositywarningsrv   descriptionsr   TextTestResult	tb_localsassertIsNone	durations)r=   r-   s     r   	test_initzTest_TextTestRunner.test_init  s    ((*)'))1-$/++,++X-D-DE))*&**+r   c                      G fddt         j                         G d dt         j                        } |d d d       y )Nc                   "     e Zd Z fdZ xZS )>Test_TextTestRunner.test_multiple_inheritance.<locals>.AResultc                 (    t         |   |||       y r	   )superr>   )r=   r   r  r  AResult	__class__s       r   r>   zGTest_TextTestRunner.test_multiple_inheritance.<locals>.AResult.__init__  s    gt-flINr   )r   r   r   r>   __classcell__)r  r  s   @r   r  r    s    O Or   r  c                       e Zd Zy)BTest_TextTestRunner.test_multiple_inheritance.<locals>.ATextResultNr   r   r   r   ATextResultr    r  r   r  r_   )r
   r   r  )r=   r  r  s     @r   test_multiple_inheritancez-Test_TextTestRunner.test_multiple_inheritance  s9    	Oh)) 	O	(117 	
 	D$"r   c                 b    G d dt         j                        }t        j                         t        j                  t	        j
                         dd      }fd|_        |j                   |d             | j                  j                         | j                  j                         y )Nc                       e Zd Zd Zy)7Test_TextTestRunner.testBufferAndFailfast.<locals>.Testc                      y r	   r   rA   s    r   testFooz?Test_TextTestRunner.testBufferAndFailfast.<locals>.Test.testFoo  rY   r   Nr   r   r   r  r   r   r   Testr    r\   r   r  T)r   r~  r  c                       S r	   r   r~   s   r   <lambda>z;Test_TextTestRunner.testBufferAndFailfast.<locals>.<lambda>      V r   r  )r
   rq   r   r   r   r   _makeResultr(   rv   r~  r  )r=   r  r-   r   s      @r   testBufferAndFailfastz)Test_TextTestRunner.testBufferAndFailfast  s|    	8$$ 	 $$&((046 ,

4	?#(&r   c                     t        j                  t        j                         d      }|j	                  t        j
                               }| j                  d|j                         y )NT)r   r  )r
   r   r   r   r(   r#   rr   r  )r=   r-   r   s      r   test_localszTest_TextTestRunner.test_locals  sG    ((NH..01v//0r   c                      G d dt         j                        }t         j                  j                  fd} j	                  |       t        j
                         t        j                  t        j                               }fd|_	        d _
         fd}|t         j                  _        |j                  t        j                                 j                   j                  d       y )	Nc                       e Zd Zd Zy);Test_TextTestRunner.testRunnerRegistersResult.<locals>.Testc                      y r	   r   rA   s    r   r  zCTest_TextTestRunner.testRunnerRegistersResult.<locals>.Test.testFoo  rY   r   Nr  r   r   r   r  r    r\   r   r  c                  0     t         j                  _        y r	   )r
   r-   registerResult)originalRegisterResults   r   r8   z>Test_TextTestRunner.testRunnerRegistersResult.<locals>.cleanup  s    -CHOO*r   )r   c                       S r	   r   r~   s   r   r  z?Test_TextTestRunner.testRunnerRegistersResult.<locals>.<lambda>  r  r   r   c                 T    xj                   dz  c_         j                  |        y r^   )wasRegisteredrr   )
thisResultr   r=   s    r   fakeRegisterResultzITest_TextTestRunner.testRunnerRegistersResult.<locals>.fakeRegisterResult  s$    !#Z0r   r_   )r
   rq   r-   r  rt   r   r   r   r   r  r  r(   r#   rr   )r=   r  r8   r-   r  r  r   s   `    @@r   testRunnerRegistersResultz-Test_TextTestRunner.testRunnerRegistersResult  s    	8$$ 	 "*!?!?	D $$&((>+	1 *<&

8%%'(++Q/r   c                      G d dt                G fddt        j                                }|j                  t        j                                y )Nc                       e Zd ZdZd Zy)bTest_TextTestRunner.test_works_with_result_without_startTestRun_stopTestRun.<locals>.OldTextResultr!   c                      y r	   r   rA   s    r   printErrorsznTest_TextTestRunner.test_works_with_result_without_startTestRun_stopTestRun.<locals>.OldTextResult.printErrors  rY   r   Nr   r   r   
separator2r  r   r   r   OldTextResultr        Jr   r  c                   ,     e Zd Z fdZfdZ xZS )[Test_TextTestRunner.test_works_with_result_without_startTestRun_stopTestRun.<locals>.Runnerc                 H    t         |   t        j                                y r	   )r  r>   r   r   )r=   Runnerr  s    r   r>   zdTest_TextTestRunner.test_works_with_result_without_startTestRun_stopTestRun.<locals>.Runner.__init__  s    fd,R[[];r   c                             S r	   r   )r=   r  s    r   r  zgTest_TextTestRunner.test_works_with_result_without_startTestRun_stopTestRun.<locals>.Runner._makeResult  s    $&r   r   r   r   r>   r  r  )r  r  r  s   @r   r  r    s    <' 'r   r  )r   r
   r   r(   r#   )r=   r-   r  r  s     @@r   7test_works_with_result_without_startTestRun_stopTestRunzKTest_TextTestRunner.test_works_with_result_without_startTestRun_stopTestRun  s@    	? 	
	'X,, 	' 

8%%'(r   c                      G d dt                G fddt        j                        g } |      }|j                  t        j                                ddg}| j                  ||       y )Nc                       e Zd ZdZd Zy)STest_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingTextResultr!   c                      y r	   r   rA   s    r   r  z_Test_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingTextResult.printErrors   rY   r   Nr  r   r   r   LoggingTextResultr    r  r   r  c                   ,     e Zd Z fdZfdZ xZS )OTest_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingRunnerc                 V    t         |   t        j                                || _        y r	   )r  r>   r   r   _events)r=   eventsLoggingRunnerr  s     r   r>   zXTest_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingRunner.__init__  s    mT3BKKMB%r   c                 (     | j                         S r	   )r  )r=   r  s    r   r  z[Test_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingRunner._makeResult  s    (66r   r  )r  r  r  s   @r   r  r    s    &7 7r   r  startTestRunstopTestRun)r   r
   r   r(   r#   rr   )r=   r  r-   expectedr  r  s       @@r   $test_startTestRun_stopTestRun_calledz8Test_TextTestRunner.test_startTestRun_stopTestRun_called  sa    	 	
	7H33 	7 v&

8%%'("M2*r   c                 b   t        j                  d      }t        j                  |      }t	        dt
        j                  dz         D ]e  }t        j                  ||      }t        j                  |      }| j                  |j                  j                         |j                                g y )Nr   rh   r_   )r   r   r
   r   rangepickleHIGHEST_PROTOCOLdumpsloadsrr   r   r  )r=   r   r-   protocolsobjs         r   test_pickle_unpicklez(Test_TextTestRunner.test_pickle_unpickle  s     U#((0a!8!81!<= 	GHVX.A,,q/CSZZ002FOO4EF		Gr   c                    d }t               }t               }t               }t        j                  ||||      }| j                  |j                  |       |j
                  ||f}| j                  |j                         |       y )Nc                      | S r	   r   )rb   s    r   MockResultClassz=Test_TextTestRunner.test_resultclass.<locals>.MockResultClass  s    Kr   )r   )r  r
   r   rr   r   r   r  )r=   r  STREAMDESCRIPTIONS	VERBOSITYr-   expectedresults          r   test_resultclassz$Test_TextTestRunner.test_resultclass  su    	xH	((y5DF++_= --yA++-~>r   c                    d }t        t        j                  t        j                  t        j                  j                  t                    }t        j                  t        j                  ddgfi |}|5   ||      \  }}ddd       | j                  d       | j                  t              d       dD ]#  }| j                  |j                  |      d	       % d
D ]#  }| j                  |j                  |      d       % t        j                  ddgt        j                  dddgt        j                  ddgf}|D ][  }t        j                  |fi |}|5   ||      \  }}ddd       | j                  d|       | j                  t        |      d       ] t        j                  t        j                  ddgfi |}|5   ||      \  }}ddd       | j                  d|       | j                  t        |      d       dD ]#  }| j                  |j                  |      d	       % y# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xxY w)zx
        Check that warnings argument of TextTestRunner correctly affects the
        behavior of the warnings.
        c                 d    | j                         D cg c]  }|j                          c}S c c}w r	   )communicater6  )pbs     r   get_parse_out_errz<Test_TextTestRunner.test_warnings.<locals>.get_parse_out_err1  s"    ,-MMO<qALLN<<<s   -)stdoutstderrcwdz-Ez_test_warnings.pyNs   OK
   )   dw   iw   uwrj   )   rwr_   ignorez-Waz-Wir   always   )r  r  r  r  )ru   
subprocessPIPErx  pathdirname__file__Popenr  
executabler   rr   r!  count)	r=   r  optsr  outerrmsg	args_listrb   s	            r   test_warningsz!Test_TextTestRunner.test_warnings)  s$   	=:??:??13 cnnd4GHQDQ 	,(+HC	,eS!S2&( 	0CSYYs^Q/	0 	0CSYYs^Q/	0
 ^^0(;^^U$7B^^U$78
	  	*D  ..A 0,Q/S0MM%%SXq)	* cnn.A8L %#% 	,(+HC	,eS!S2&/ 	0CSYYs^Q/	0I	, 	,,0 0	, 	,s$   8H5II5H?I	Ic                    t         j                  }t        j                         }|t         _        	 t	        j
                         }| j                  |j                  j                  |u        |t         _        y # |t         _        w xY wr	   )r  r  r   r   r
   r   rv   r   )r=   
old_stderrfr-   s       r   %testStdErrLookedUpAtInstantiationTimez9Test_TextTestRunner.testStdErrLookedUpAtInstantiationTime_  sZ    ZZ
KKM
	$,,.FOOFMM00A56#CJCJs   ;A8 8Bc                     t        j                         }t        j                  |      }| j	                  |j
                  j
                  |u        y r	   )r   r   r
   r   rv   r   )r=   r  r-   s      r   testSpecifiedStreamUsedz+Test_TextTestRunner.testSpecifiedStreamUsedj  s8    KKM((+,,12r   c                     dd fd
} G d dt         j                        } | |d      d        G d dt         j                        } | |d      d        G d dt         j                        } | |d      d        G d	 dt         j                        } | |d      d        G d
 dt         j                        } | |d      d       y )NT)expect_durationsc                   t               }t        j                  |dd      }|j                  |       }j	                  |j
                  d       |j                          |j                         }d}|rJj	                  t        |j                        d       j                  d|       j                  ||       y j	                  t        |j                        d       j                  d|       j                  ||       y )N   rh   )r   r  r  z\n\d+.\d\d\dsr_   zSlowest test durationsr   )r   r
   r   r(   rr   r  flushr  r!  collectedDurationsr   assertRegexassertNotInassertNotRegex)rx   r  r   r-   r   textregexr=   s          r   r(   z/Test_TextTestRunner.test_durations.<locals>.runq  s    #%F,,FaSTUFZZ%FV--q1LLN??$D$E  V%>%>!?C6=  u-  V%>%>!?C  !94@##D%0r   c                       e Zd Zd Zy)/Test_TextTestRunner.test_durations.<locals>.Fooc                      y r	   r   rA   s    r   test_1z6Test_TextTestRunner.test_durations.<locals>.Foo.test_1  rY   r   Nr   r   r   r  r   r   r   Foor    r\   r   r  r  c                       e Zd Zd Zy)r  c                 (    | j                  dd       y )Nr   r_   )rr   rA   s    r   r  z6Test_TextTestRunner.test_durations.<locals>.Foo.test_1  s      A&r   Nr  r   r   r   r  z/Test_TextTestRunner.test_durations.<locals>.Foo  s    'r   c                       e Zd Zd Zy)r  c                     ddz   y Nr_   r   r   rA   s    r   r  z6Test_TextTestRunner.test_durations.<locals>.Foo.test_1  	    Ar   Nr  r   r   r   r  z/Test_TextTestRunner.test_durations.<locals>.Foo  s    r   c                       e Zd Zd ZeZd Zy)r  c                     ddz   y r  r   rA   s    r   r   z5Test_TextTestRunner.test_durations.<locals>.Foo.setUp  r  r   c                      y r	   r   rA   s    r   r  z6Test_TextTestRunner.test_durations.<locals>.Foo.test_1  rY   r   N)r   r   r   r   r   r  r   r   r   r  z/Test_TextTestRunner.test_durations.<locals>.Foo  s    Hr   c                   <    e Zd Z ej                  d      d        Zy)r  reasonc                      y r	   r   rA   s    r   r  z6Test_TextTestRunner.test_durations.<locals>.Foo.test_1  s    r   N)r   r   r   r
   skipr  r   r   r   r  z/Test_TextTestRunner.test_durations.<locals>.Foo  s    X]]8$ %r   F)r
   rq   )r=   r(   r  s   `  r   test_durationsz"Test_TextTestRunner.test_durationsp  s    *. 	1$	(## 	 	CMD1	'(## 	' 	CMD1	(## 	 	CMD1	(## 	 	CMD1	(## 	
 	CME2r   N)r   r   r   __doc__r   r   r  r  r  r  r  r  r  r  r  r   requires_subprocessr  r  r  r$  r   r   r   rt  rt    sl    #-?
	,
#'1
0.) +(	G? !W  "30 #30j	$383r   rt  )F) r   rx  r  r  r  rx   r   r
   unittest.caser   test.test_unittest.supportr   r   r   r   r   	Exceptionr   r   r   r/   r8   r:   rI   rK   rP   rq   rS   r   r  rt  mainr   r   r   <module>r+     s    	 	 
     " !9
	) 	 (0:'=X^2FkR!"(
% 
%	 	  
g-(## g-T]Dx(( ]D@~=)) ~=BK3(++ K3^ zHMMO r   