
    =e                        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 d Zd Z G d de          Zed	k    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j                  Z G d dej                  Z G d dej                  Z G d dej                  Zed	k    r ej                     dS dS )     N)support)_Outcome)LoggingResult#ResultWithNoStartTestRunStopTestRunc                  (    t          j                    S N)unittest
TestResult)_s    0/usr/lib/python3.11/unittest/test/test_runner.pyresultFactoryr      s           c                  Z    t          j        t          t          j                              S )N)resultclassstream)r	   TextTestRunnerr   ioStringIO r   r   	getRunnerr      s'    "}*,+--9 9 9 9r   c                       e Zd ZdS )CustomErrorN__name__
__module____qualname__r   r   r   r   r              Dr   r   __main__. c                     t          j                    }| D ]6}t           j                            |          }|                    |           7t                      }t          j                    }|                    |           |                    t          j                               |                    t          j                               |                    |          S r   )r	   	TestSuitedefaultTestLoaderloadTestsFromTestCaseaddTestsr   addTestrun)casessuitecasetestsrunner	realSuites         r   runTestsr.      s      E  *@@FFu[[F "$$Ie	MM($&&'''h(**+++::i   r   Fc                 |    |s|                      d           d S |                      d           t          d          )Ncleanup_goodcleanup_exc
CleanUpExcappendr   )orderingblowUps     r   cleanupr7   0   sB     ('''''&&&,'''r   c                   "    e Zd ZddZd Zd ZdS )TestCMNc                 "    || _         || _        d S r   )r5   enter_result)selfr5   r;   s      r   __init__zTestCM.__init__9   s     (r   c                 D    | j                             d           | j        S )Nenter)r5   r4   r;   r<   s    r   	__enter__zTestCM.__enter__=   s!    W%%%  r   c                 :    | j                             d           d S )Nexit)r5   r4   r<   exc_infos     r   __exit__zTestCM.__exit__A   s    V$$$$$r   r   )r   r   r   r=   rA   rF   r   r   r   r9   r9   8   sF        ) ) ) )! ! !% % % % %r   r9   c                       e Zd ZdS )LacksEnterAndExitNr   r   r   r   rH   rH   E   r   r   rH   c                       e Zd Zd ZdS )
LacksEnterc                     d S r   r   rD   s     r   rF   zLacksEnter.__exit__H       r   N)r   r   r   rF   r   r   r   rJ   rJ   G   #            r   rJ   c                       e Zd Zd ZdS )	LacksExitc                     d S r   r   r@   s    r   rA   zLacksExit.__enter__K   rL   r   N)r   r   r   rA   r   r   r   rO   rO   J   rM   r   rO   c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestCleanUpc           
          G d dt           j                  } |d          }|                     |j        g            g fd}fd}|                    |dddd	d
           |                    |           |                     |j        |dt          d	d
          f|di fg           |                     |                                           |                     ddi fddt          d	d
          fg           d S )Nc                       e Zd Zd ZdS )-TestCleanUp.testCleanUp.<locals>.TestableTestc                     d S r   r   r@   s    r   testNothingz9TestCleanUp.testCleanUp.<locals>.TestableTest.testNothingR       r   Nr   r   r   rW   r   r   r   TestableTestrU   Q   #            r   rZ   rW   c                  8                         d| |f           d S N   r4   argskwargscleanupss     r   cleanup1z)TestCleanUp.testCleanUp.<locals>.cleanup1Z   "    OOQf-.....r   c                  8                         d| |f           d S )N   r_   r`   s     r   cleanup2z)TestCleanUp.testCleanUp.<locals>.cleanup2]   re   r   r^   rg      hellogoodbyefourfiver^   rg   ri   r   )r	   TestCaseassertEqual	_cleanups
addCleanupdict
assertTrue
doCleanups)r<   rZ   testrd   rh   rc   s        @r   testCleanUpzTestCleanUp.testCleanUpP   s^   	 	 	 	 	8, 	 	 	 |M**,,,	/ 	/ 	/ 	/ 	/	/ 	/ 	/ 	/ 	/ 	!QiHHH!!!#Y'	0R0R0RS#R,.	/ 	/ 	/ 	))***QBK!Y'Xa@b@b@b1c#deeeeer   c                   
  G d dt           j                  } |d          }t          j                    }t          |          x}|_        t          d          
t          d          
fd}fd}|                    |           |                    |           |                     |                                           |                     |j	                   |j
        \  \  }}\  }}	|                     d	|	           |                     d
|	           |                     t           d|	           |                     d|           |                     d|           |                     t           d|           d S )Nc                       e Zd Zd ZdS )7TestCleanUp.testCleanUpWithErrors.<locals>.TestableTestc                     d S r   r   r@   s    r   rW   zCTestCleanUp.testCleanUpWithErrors.<locals>.TestableTest.testNothingl   rX   r   NrY   r   r   r   rZ   r{   k   r[   r   rZ   rW   resultfoobarc                       r   r   )r2   s   r   rd   z3TestCleanUp.testCleanUpWithErrors.<locals>.cleanup1u   s	    r   c                       r   r   )exc2s   r   rh   z3TestCleanUp.testCleanUpWithErrors.<locals>.cleanup2x   s    Jr   zin cleanup1zraise CleanUpExcz: foozin cleanup2z
raise exc2z: bar)r	   rp   r
   r   _outcomer   rs   assertFalserv   successerrorsassertInCustomErrorRepr)r<   rZ   rw   r~   outcomerd   rh   r   msg2msg1r2   r   s             @@r   testCleanUpWithErrorsz!TestCleanUp.testCleanUpWithErrorsj   s   	 	 	 	 	8, 	 	 	 |M**$&&"*&"9"9"99$- ''
5!!	 	 	 	 		 	 	 	 	 	!!!!!!**+++)))%}	D9AtmT***($//////666mT***lD)))///66666r   c                    	 dg  G 	fddt           j                  } |d          	fd}fdfd	                    |            	fd}t          j                    }||_        	                    |                                g d	           d
g  |d          		                    |           	                    |                                g d           d S )NFc                   8    e Zd Z fdZfdZfdZdS )2TestCleanUp.testCleanupInRun.<locals>.TestableTestc                 ~                         d                                          rt          d          d S )NsetUpr   )r4   rs   r   )r<   r6   rh   r5   rw   s    r   r   z8TestCleanUp.testCleanupInRun.<locals>.TestableTest.setUp   sG    ((())) -%e,,,- -r   c                 \                         d                                          d S Nrw   r4   rs   )r<   cleanup3r5   rw   s    r   rW   z>TestCleanUp.testCleanupInRun.<locals>.TestableTest.testNothing   -    ''')))))r   c                 2                         d           d S NtearDownr_   r<   r5   s    r   r   z;TestCleanUp.testCleanupInRun.<locals>.TestableTest.tearDown       
+++++r   Nr   r   r   r   rW   r   )r6   rh   r   r5   rw   s   r   rZ   r      sy        - - - - - - - -* * * * * * *, , , , , , ,r   rZ   rW   c                  2                          d           d S Nrd   r_   r5   s   r   rd   z.TestCleanUp.testCleanupInRun.<locals>.cleanup1       OOJ'''''r   c                  2                          d           d S Nrh   r_   r   s   r   rh   z.TestCleanUp.testCleanupInRun.<locals>.cleanup2   r   r   c                  2                          d           d S Nr   r_   r   s   r   r   z.TestCleanUp.testCleanupInRun.<locals>.cleanup3   r   r   c                 ^                         |                                d           d S )Nr   )rq   r4   )	some_testr5   r<   rw   s    r   r   z-TestCleanUp.testCleanupInRun.<locals>.success   s1    Y---OOI&&&&&r   )r   rw   r   r   rh   rd   r   T)r   rh   rd   )r	   rp   rs   r
   
addSuccessr'   rq   )
r<   rZ   rd   r   r~   r6   rh   r   r5   rw   s
   `    @@@@@r   testCleanupInRunzTestCleanUp.testCleanupInRun   s   	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,8, 	, 	, 	, |M**	( 	( 	( 	( 	(	( 	( 	( 	( 	(	( 	( 	( 	( 	(!!!	' 	' 	' 	' 	' 	' 	' $&&# $G $G $G 	H 	H 	H |M**!!!#D#D#DEEEEEr   c                     g  G fddt           j                  } |d          fdfdfdfd                                 |                     g d           d S )	Nc                   6    e Zd Z fdZfdZfdZdS )CTestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.TestableTestc                 \                         d           |                                d S Nr   r   )r<   rd   r5   s    r   r   zITestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.TestableTest.setUp   -    ((()))))r   c                 \                         d           |                                d S r   r   r<   r   r5   s    r   rW   zOTestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.TestableTest.testNothing   r   r   c                 \                         d                                          d S r   r   )r<   cleanup4r5   rw   s    r   r   zLTestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.TestableTest.tearDown   s-    
+++)))))r   Nr   )rd   r   r   r5   rw   s   r   rZ   r      st        * * * * * ** * * * * ** * * * * * * * *r   rZ   rW   c                  \                         d                                           d S r   r   )rh   r5   rw   s   r   rd   z?TestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.cleanup1   s-    OOJ'''OOH%%%%%r   c                  2                          d           d S r   r_   r   s   r   rh   z?TestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.cleanup2   r   r   c                  2                          d           d S r   r_   r   s   r   r   z?TestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.cleanup3   r   r   c                  2                          d           d S )Nr   r_   r   s   r   r   z?TestCleanUp.testTestCaseDebugExecutesCleanups.<locals>.cleanup4   r   r   )r   rw   r   r   r   rd   rh   )r	   rp   debugrq   )r<   rZ   rd   rh   r   r   r5   rw   s     @@@@@@r   !testTestCaseDebugExecutesCleanupsz-TestCleanUp.testTestCaseDebugExecutesCleanups   s!   	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*8, 	* 	* 	* |M**	& 	& 	& 	& 	& 	& 	&	( 	( 	( 	( 	(	( 	( 	( 	( 	(	( 	( 	( 	( 	( 	

 $H $H $H 	I 	I 	I 	I 	Ir   c                     G d dt           j                  } |d          }g }|                    |j        d           t	          |d          }|                     |                    |          d           |                    |j        d           |                     |                                           |                     |g d           d S )Nc                       e Zd Zd ZdS )3TestCleanUp.test_enterContext.<locals>.TestableTestc                     d S r   r   r@   s    r   rW   z?TestCleanUp.test_enterContext.<locals>.TestableTest.testNothing   rX   r   NrY   r   r   r   rZ   r      r[   r   rZ   rW   rd   *   rh   r?   rh   rC   rd   )	r	   rp   rs   r4   r9   rq   enterContextru   rv   )r<   rZ   rw   rc   cms        r   test_enterContextzTestCleanUp.test_enterContext   s    	 	 	 	 	8, 	 	 	 |M**444Hb!!**2..333444))***#L#L#LMMMMMr   c                 z    G d dt           j                  } |d          }|                     t          d          5  |                    t                                 d d d            n# 1 swxY w Y   |                     t          d          5  |                    t                                 d d d            n# 1 swxY w Y   |                     t          d          5  |                    t                                 d d d            n# 1 swxY w Y   |                     |j	        g            d S )Nc                       e Zd Zd ZdS )>TestCleanUp.test_enterContext_arg_errors.<locals>.TestableTestc                     d S r   r   r@   s    r   rW   zJTestCleanUp.test_enterContext_arg_errors.<locals>.TestableTest.testNothing   rX   r   NrY   r   r   r   rZ   r      r[   r   rZ   rW   the context manager)
r	   rp   assertRaisesRegex	TypeErrorr   rH   rJ   rO   rq   rr   )r<   rZ   rw   s      r   test_enterContext_arg_errorsz(TestCleanUp.test_enterContext_arg_errors   s   	 	 	 	 	8, 	 	 	 |M**##I/DEE 	3 	3/11222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3##I/DEE 	, 	,jll+++	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,##I/DEE 	+ 	+ikk***	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	,,,,,s5   "A--A14A1"CCC'"DDDN)	r   r   r   rx   r   r   r   r   r   r   r   r   rR   rR   O   s|        f f f47 7 7>,F ,F ,F\I I IBN N N - - - - -r   rR   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S )TestClassCleanupc           
          G d dt           j                  } |d          }|                     |j        g            g fd}fd}|                    |dddd	d
           |                    |           |                     |j        |dt          d	d
          f|di fg           |                                 |                     ddi fddt          d	d
          fg           d S )Nc                       e Zd Zd ZdS );TestClassCleanup.test_addClassCleanUp.<locals>.TestableTestc                     d S r   r   r@   s    r   rW   zGTestClassCleanup.test_addClassCleanUp.<locals>.TestableTest.testNothing   rX   r   NrY   r   r   r   rZ   r      r[   r   rZ   rW   c                  8                         d| |f           d S Nri   r_   ra   rb   class_cleanupss     r   class_cleanup1z=TestClassCleanup.test_addClassCleanUp.<locals>.class_cleanup1  $    !!1dF"344444r   c                  8                         d| |f           d S N   r_   r   s     r   class_cleanup2z=TestClassCleanup.test_addClassCleanUp.<locals>.class_cleanup2  r   r   r^   rg   ri   rj   rk   rl   ro   r   r   )r	   rp   rq   _class_cleanupsaddClassCleanuprt   doClassCleanups)r<   rZ   rw   r   r   r   s        @r   test_addClassCleanUpz%TestClassCleanup.test_addClassCleanUp   s   	 	 	 	 	8, 	 	 	 |M**-r222	5 	5 	5 	5 	5	5 	5 	5 	5 	5 	$$^Q1*1	 	% 	C 	C 	C$$^444-)9W9===?)2r24	5 	5 	5
 	$$&&&1b"+9*.G)*L*L*L8N *O 	P 	P 	P 	P 	Pr   c                     g d G fddt           j                  }t          |           |                     ddg           g dt          |           |                     g d           d S )NTc                   P    e Zd Ze fd            ZfdZefd            ZdS )=TestClassCleanup.test_run_class_cleanUp.<locals>.TestableTestc                                          d           |                     t                     rt                      d S N
setUpClassr4   r   r7   r   clsr6   r5   s    r   r   zHTestClassCleanup.test_run_class_cleanUp.<locals>.TestableTest.setUpClass  G    ---##GX666 (%--'( (r   c                 2                         d           d S r   r_   r   s    r   rW   zITestClassCleanup.test_run_class_cleanUp.<locals>.TestableTest.testNothing       '''''r   c                 2                         d           d S NtearDownClassr_   r   r5   s    r   r   zKTestClassCleanup.test_run_class_cleanUp.<locals>.TestableTest.tearDownClass"      00000r   Nr   r   r   classmethodr   rW   r   r6   r5   s   r   rZ   r     sy        ( ( ( ( ( [(
( ( ( ( (1 1 1 1 [1 1 1r   rZ   r   r0   Fr   rw   r   r0   r	   rp   r.   rq   r<   rZ   r6   r5   s     @@r   test_run_class_cleanUpz'TestClassCleanup.test_run_class_cleanUp  s    	1 	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1 	L.#ABBBPPP	R 	R 	R 	R 	Rr   c                     g d G fddt           j                  }t          |           |                     ddg           g dt          |           |                     g d           d S )NTc                   \    e Zd Ze fd            ZfdZeed                         ZdS )STestClassCleanup.test_run_class_cleanUp_without_tearDownClass.<locals>.TestableTestc                                          d           |                     t                     rt                      d S r   r   r   s    r   r   z^TestClassCleanup.test_run_class_cleanUp_without_tearDownClass.<locals>.TestableTest.setUpClass4  r   r   c                 2                         d           d S r   r_   r   s    r   rW   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   rW   propertyr   r   s   r   rZ   r   3  sy        ( ( ( ( ( [(
( ( ( ( (% % X [% % %r   rZ   r   r0   F)r   rw   r0   r   r   s     @@r   ,test_run_class_cleanUp_without_tearDownClassz=TestClassCleanup.test_run_class_cleanUp_without_tearDownClass/  s    	% 	% 	% 	% 	% 	% 	% 	%8, 	% 	% 	% 	L.#ABBB???	A 	A 	A 	A 	Ar   c                 0   g d G fddt           j                  }t           j                            |          }|                                 |                     g d           g dt           j                            |          }|                     t                    5 }|                                 d d d            n# 1 swxY w Y   |                     t          |j	                  d           |                     g d           d S )NFc                   P    e Zd Ze fd            ZfdZefd            ZdS )GTestClassCleanup.test_debug_executes_classCleanUp.<locals>.TestableTestc                 l                         d           |                     t                     d S Nr   r6   r4   r   r7   r   s    r   r   zRTestClassCleanup.test_debug_executes_classCleanUp.<locals>.TestableTest.setUpClassO  6    ---##GXf#EEEEEr   c                 2                         d           d S r   r_   r   s    r   rW   zSTestClassCleanup.test_debug_executes_classCleanUp.<locals>.TestableTest.testNothingS  r   r   c                 2                         d           d S r   r_   r   s    r   r   zUTestClassCleanup.test_debug_executes_classCleanUp.<locals>.TestableTest.tearDownClassU  r   r   Nr   r   s   r   rZ   r  N  s        F F F F F [F( ( ( ( (1 1 1 1 [1 1 1r   rZ   r   Tr2   )r   rw   r   r1   )
r	   rp   r#   r$   r   rq   assertRaisesr   str	exceptionr<   rZ   r)   r   r6   r5   s       @@r    test_debug_executes_classCleanUpz1TestClassCleanup.test_debug_executes_classCleanUpJ  s|   		1 		1 		1 		1 		1 		1 		1 		18, 		1 		1 		1 *@@NNPPP	R 	R 	R *@@NN{++ 	rKKMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	R\**L999OOO	Q 	Q 	Q 	Q 	Qs   *CCCc                    g d G fddt           j                  }t           j                            |          }|                     t
                    5 }|                                 d d d            n# 1 swxY w Y   |                     t          |j	                  d           |                     g d           | 
                    |j                   |j                                         g dt           j                            |          }|                     t
                    5 }|                                 d d d            n# 1 swxY w Y   |                     t          |j	                  d           |                     g d           | 
                    |j                   |j                                         d S )NFc                   P    e Zd Ze fd            ZfdZefd            ZdS )_TestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exception.<locals>.TestableTestc                 l                         d           |                     t                     d S r  r  r   s    r   r   zjTestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exception.<locals>.TestableTest.setUpClassl  r  r   c                 2                         d           d S r   r_   r   s    r   rW   zkTestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exception.<locals>.TestableTest.testNothingp  r   r   c                 L                         d           t          d          )Nr   TearDownClassExcr3   r   s    r   r   zmTestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exception.<locals>.TestableTest.tearDownClassr  s$    000!"4555r   Nr   r   s   r   rZ   r  k  s        F F F F F [F( ( ( ( (6 6 6 6 [6 6 6r   rZ   r  )r   rw   r   T)r	   rp   r#   r$   r
  r   r   rq   r  r  ru   r   clearr  s       @@r   8test_debug_executes_classCleanUp_when_teardown_exceptionzITestClassCleanup.test_debug_executes_classCleanUp_when_teardown_exceptiong  s>   
	6 
	6 
	6 
	6 
	6 
	6 
	6 
	68, 
	6 
	6 
	6 *@@NN{++ 	rKKMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	R\**,>???#J#J#JKKK4555$**,,,*@@NN{++ 	rKKMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	R\**,>???#J#J#JKKK4555$**,,,,,s$   A<<B B 7EEEc                 J    G d dt           j                  }d }d }|                    |           |                    |           |                                 |                     t          |j                  d           |j        \  }}|                     |d         t                     |                     t          |d                   d           |                     |d         t                     |                     t          |d                   d           d S )	Nc                       e Zd Zd ZdS )WTestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp.<locals>.TestableTestc                     d S r   r   r@   s    r   rW   zcTestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp.<locals>.TestableTest.testNothing  rX   r   NrY   r   r   r   rZ   r    r[   r   rZ   c                       t          d          r   r   r   r   r   rd   zSTestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp.<locals>.cleanup1      j)))r   c                       t          d          r   r  r   r   r   rh   zSTestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp.<locals>.cleanup2  r  r   rg   r^   rh   rd   )
r	   rp   r   r   rq   lentearDown_exceptionsassertIsInstancer   r  )r<   rZ   rd   rh   e1e2s         r   0test_doClassCleanups_with_errors_addClassCleanUpzATestClassCleanup.test_doClassCleanups_with_errors_addClassCleanUp  s0   	 	 	 	 	8, 	 	 		* 	* 	*	* 	* 	* 	$$X...$$X...$$&&&\=>>BBB1Bbe[111RUZ000be[111RUZ00000r   c                    g  G fddt           j                  }t          |          }|                     |j        d         d                                         d         t           d           |                     g d           d S )Nc                   T    e Zd Ze fd            Z fdZd Ze fd            ZdS )BTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTestc                 h                         d           |                     t                     d S r   r  r   s    r   r   zMTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTest.setUpClass  1    ---##GX66666r   c                 l                         d           |                     t          d           d S Nr   Tr  r4   rs   r7   r   s    r   r   zHTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTest.setUp  3    ((($?????r   c                     d S r   r   r@   s    r   rW   zNTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTest.testNothing  rX   r   c                 2                         d           d S r   r_   r   s    r   r   zPTestClassCleanup.test_with_errors_addCleanUp.<locals>.TestableTest.tearDownClass  r   r   Nr   r   r   r   r   r   rW   r   r   s   r   rZ   r(    s        7 7 7 7 [7@ @ @ @ @  1 1 1 1 [1 1 1r   rZ   r   r^   : CleanUpExc)r   r   r1   r   r0   r	   rp   r.   rq   r   
splitlinesr   r<   rZ   r~   r5   s      @r   test_with_errors_addCleanUpz,TestClassCleanup.test_with_errors_addCleanUp  s    	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1 ,''q)!,7799"=+999	; 	; 	;; ; ;	< 	< 	< 	< 	<r   c                    g  G fddt           j                  }t          |          }|                     |j        d         d                                         d         t           d           |                     g d           d S )Nc                   X    e Zd Ze fd            Z fdZ fdZe fd            ZdS )KTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTestc                 l                         d           |                     t          d           d S Nr   Tr  r  r   s    r   r   zVTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTest.setUpClass  6    ---##GXd#CCCCCr   c                 h                         d           |                     t                     d S r   r-  r   s    r   r   zQTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTest.setUp  s/    (((22222r   c                 2                         d           d S r   r_   r   s    r   rW   zWTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTest.testNothing  r   r   c                 2                         d           d S r   r_   r   s    r   r   zYTestClassCleanup.test_run_with_errors_addClassCleanUp.<locals>.TestableTest.tearDownClass  r   r   Nr1  r   s   r   rZ   r:    s        D D D D [D3 3 3 3 3( ( ( ( (1 1 1 1 [1 1 1r   rZ   r   r^   r2  r3  )r   r   rw   r0   r   r1   r4  r6  s      @r   $test_run_with_errors_addClassCleanUpz5TestClassCleanup.test_run_with_errors_addClassCleanUp  s    	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1 ,''q)!,7799"=+999	; 	; 	;: : :	; 	; 	; 	; 	;r   c                    g dd G fddt           j                  }t          |          }|                     |j        d         d                                         d         t           d           |                     g d           g d	dt          |          }|                     |j        d         d                                         d         t           d
           |                     |j        d         d                                         d         t           d           |                     ddg           g dd	t          |          }|                     |j        d         d                                         d         t           d           |                     |j        d         d                                         d         t           d           |                     g d           d S )NFc                   \    e Zd Ze fd            ZfdZfdZefd            ZdS )UTestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTestc                                          d           |                     t          d           rt          d          d S )Nr   Tr  ClassExcr   r   class_blow_upr5   s    r   r   z`TestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTest.setUpClass  sP    ---##GXd#CCC  2%j1112 2r   c                 T                         d           rt          d          d S Nr   	MethodExcr3   r<   method_blow_upr5   s    r   r   z[TestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTest.setUp  5    (((! 3%k2223 3r   c                 2                         d           d S r   r_   r   s    r   rW   zaTestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTest.testNothing  r   r   c                 2                         d           d S r   r_   r   s    r   r   zcTestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps.<locals>.TestableTest.tearDownClass  r   r   Nr1  rH  rM  r5   s   r   rZ   rD    s        2 2 2 2 2 [2
3 3 3 3 3 3( ( ( ( (1 1 1 1 [1 1 1r   rZ   r   r^   r2  r3  )r   r   rw   r   r1   T
: ClassExcr   r1   : MethodExc)r   r   r   r1   r4  )r<   rZ   r~   rH  rM  r5   s      @@@r   .test_with_errors_in_addClassCleanup_and_setUpsz?TestClassCleanup.test_with_errors_in_addClassCleanup_and_setUps  sm   	1 	1 	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1" ,''q)!,7799"=+999	; 	; 	;: : :	; 	; 	; ,''q)!,7799"=+777	9 	9 	9q)!,7799"=+999	; 	; 	;&6	8 	8 	8 ,''q)!,7799"=+888	: 	: 	:q)!,7799"=+999	; 	; 	;) ) )	* 	* 	* 	* 	*r   c                    g  G fddt           j                  }t          |          }|                     |j        d         d                                         d         t           d           |                     g d           d S )Nc                   N    e Zd Ze fd            Z fdZe fd            ZdS )HTestClassCleanup.test_with_errors_in_tearDownClass.<locals>.TestableTestc                 h                         d           |                     t                     d S r   r  r   s    r   r   zSTestClassCleanup.test_with_errors_in_tearDownClass.<locals>.TestableTest.setUpClass  r*  r   c                 2                         d           d S r   r_   r   s    r   rW   zTTestClassCleanup.test_with_errors_in_tearDownClass.<locals>.TestableTest.testNothing	  r   r   c                 L                         d           t          d          )Nr   TearDownExcr3   r   s    r   r   zVTestClassCleanup.test_with_errors_in_tearDownClass.<locals>.TestableTest.tearDownClass  s#    000!-000r   Nr   r   s   r   rZ   rW    st        7 7 7 7 [7( ( ( ( (1 1 1 1 [1 1 1r   rZ   r   r^   r2  z: TearDownExcr   r4  r6  s      @r   !test_with_errors_in_tearDownClassz2TestClassCleanup.test_with_errors_in_tearDownClass  s    
	1 
	1 
	1 
	1 
	1 
	1 
	18, 
	1 
	1 
	1 ,''q)!,7799"=+:::	< 	< 	<PPP	R 	R 	R 	R 	Rr   c                 p    G d dt           j                  }g }|                    |j        d           t	          |d          }|                     |                    |          d           |                    |j        d           |                                 |                     |g d           d S )Nc                       e Zd Zd ZdS )=TestClassCleanup.test_enterClassContext.<locals>.TestableTestc                     d S r   r   r@   s    r   rW   zITestClassCleanup.test_enterClassContext.<locals>.TestableTest.testNothing  rX   r   NrY   r   r   r   rZ   r_    r[   r   rZ   rd   r   rh   r   )r	   rp   r   r4   r9   rq   enterClassContextr   )r<   rZ   rc   r   s       r   test_enterClassContextz'TestClassCleanup.test_enterClassContext  s    	 	 	 	 	8, 	 	 	 $$X_jAAAHb!!77;;R@@@$$X_jAAA$$&&&#L#L#LMMMMMr   c                 d    G d dt           j                  }|                     t          d          5  |                    t                                 d d d            n# 1 swxY w Y   |                     t          d          5  |                    t                                 d d d            n# 1 swxY w Y   |                     t          d          5  |                    t                                 d d d            n# 1 swxY w Y   |                     |j	        g            d S )Nc                       e Zd Zd ZdS )HTestClassCleanup.test_enterClassContext_arg_errors.<locals>.TestableTestc                     d S r   r   r@   s    r   rW   zTTestClassCleanup.test_enterClassContext_arg_errors.<locals>.TestableTest.testNothing'  rX   r   NrY   r   r   r   rZ   re  &  r[   r   rZ   r   )
r	   rp   r   r   ra  rH   rJ   rO   rq   r   r<   rZ   s     r   !test_enterClassContext_arg_errorsz2TestClassCleanup.test_enterClassContext_arg_errors%  s   	 	 	 	 	8, 	 	 	 ##I/DEE 	@ 	@**+<+>+>???	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@##I/DEE 	9 	9**:<<888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9##I/DEE 	8 	8**9;;777	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	5r:::::s5   "A""A&)A&"B66B:=B:"D

DDc                     g  G fddt           j                   G fddt           j                  }t          |           |                     g d           d S )Nc                   4    e Zd Ze fd            Z fdZdS )8TestClassCleanup.test_run_nested_test.<locals>.InnerTestc                 h                         d           |                     j         d           d S )Ninner setupinner cleanupr4   r   r   s    r   r   zCTestClassCleanup.test_run_nested_test.<locals>.InnerTest.setUpClass7  3    ...##HO_EEEEEr   c                 2                         d           d S )N
inner testr_   r   s    r   rw   z=TestClassCleanup.test_run_nested_test.<locals>.InnerTest.test;  s    -----r   Nr   r   r   r   r   rw   r   s   r   	InnerTestrk  6  sV        F F F F [F. . . . . . .r   rt  c                   6    e Zd Zefd            Z fdZdS )8TestClassCleanup.test_run_nested_test.<locals>.OuterTestc                 h                         d           |                     j         d           d S )Nouter setupouter cleanupro  r   s    r   r   zCTestClassCleanup.test_run_nested_test.<locals>.OuterTest.setUpClass?  rp  r   c                 z                         d           t                                          d           d S )Nstart outer testend outer test)r4   r.   )r<   rt  r5   s    r   rw   z=TestClassCleanup.test_run_nested_test.<locals>.OuterTest.testC  s=     2333### 011111r   Nrs  )rt  r5   s   r   	OuterTestrv  >  s[        F F F F [F2 2 2 2 2 2 2 2r   r}  )rx  r{  rm  rr  rn  r|  ry  r   )r<   r}  rt  r5   s     @@r   test_run_nested_testz%TestClassCleanup.test_run_nested_test3  s    	. 	. 	. 	. 	. 	. 	.) 	. 	. 	.	2 	2 	2 	2 	2 	2 	2 	2) 	2 	2 	2 	 $3 $3 $3 	4 	4 	4 	4 	4r   N)r   r   r   r   r   r   r  r  r%  r7  rA  rT  r\  rb  rh  r~  r   r   r   r   r      s        P P P6R R R4A A A6Q Q Q: -  -  -D1 1 1.< < <.; ; ;.2* 2* 2*hR R R(N N N; ; ;4 4 4 4 4r   r   c                   t    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dS )TestModuleCleanUpc           
         g fdfd G fddt                     }|                     t          j        j        dt          dd          fd	i fg           t          j                                         |                     d
d	i fddt          dd          fg           |                     t          j        j        g            d S )Nc                  8                         d| |f           d S r   r_   ra   rb   module_cleanupss     r   module_cleanup1zHTestModuleCleanUp.test_add_and_do_ModuleCleanup.<locals>.module_cleanup1S  $    ""AtV#455555r   c                  8                         d| |f           d S r   r_   r  s     r   module_cleanup2zHTestModuleCleanUp.test_add_and_do_ModuleCleanup.<locals>.module_cleanup2V  r  r   c                   \    e Zd Z ej         ddddd            ej                   dS )?TestModuleCleanUp.test_add_and_do_ModuleCleanup.<locals>.Moduler^   rg   ri   rj   rk   rl   Nr   r   r   r	   addModuleCleanup)r  r  s   r   Moduler  Y  sQ        %H%oq!Q+2D D D D%H%o66666r   r  ro   rj   rk   rl   r   r   ri   )objectrq   r	   r*   _module_cleanupsrt   doModuleCleanups)r<   r  r  r  r  s     @@@r   test_add_and_do_ModuleCleanupz/TestModuleCleanUp.test_add_and_do_ModuleCleanupP  s;   	6 	6 	6 	6 	6	6 	6 	6 	6 	6	7 	7 	7 	7 	7 	7 	7 	7V 	7 	7 	7
 	7*IW9===?*B35	6 	6 	6
 	&&(((Ar2;I*.G)*L*L*L9N +O 	P 	P 	P7<<<<<r   c           	         g fdd  G fddt                     }|                     t          j        j        dt          dd          fd	i fg           |                     t                    5 }t          j                                         d d d            n# 1 swxY w Y   |                     t          |j
                  d
           |                     t          j        j        g            d S )Nc                  8                         d| |f           d S r   r_   r  s     r   module_cleanup_goodzcTestModuleCleanUp.test_doModuleCleanup_with_errors_in_addModuleCleanup.<locals>.module_cleanup_goodk  r  r   c                       t          d          )Nr2   r  )ra   rb   s     r   module_cleanup_badzbTestModuleCleanUp.test_doModuleCleanup_with_errors_in_addModuleCleanup.<locals>.module_cleanup_badn  s    l+++r   c                   \    e Zd Z ej        ddddd            ej                    dS )VTestModuleCleanUp.test_doModuleCleanup_with_errors_in_addModuleCleanup.<locals>.Moduler^   rg   ri   rj   rk   rl   Nr  )r  r  s   r   r  r  q  sS        %H%&91a+2D D D D%H%&899999r   r  ro   rj   rk   rl   r   r2   )r  rq   r	   r*   r  rt   r
  r   r  r  r  )r<   r  er  r  r  s      @@@r   4test_doModuleCleanup_with_errors_in_addModuleCleanupzFTestModuleCleanUp.test_doModuleCleanup_with_errors_in_addModuleCleanuph  sr   	6 	6 	6 	6 	6	, 	, 	,	: 	: 	: 	: 	: 	: 	: 	:V 	: 	: 	: 	7.	W9===?-r268	9 	9 	9 {++ 	-qM**,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-Q[))<8887<<<<<s   :B%%B),B)c                      g fd G  fddt                     }t          j                                                              dddifg           d S )Nc                  6                         | |f           d S r   r_   r`   s     r   r7   zCTestModuleCleanUp.test_addModuleCleanup_arg_errors.<locals>.cleanup      OOT6N+++++r   c                   0   e Zd Z ej         ddd                               e          5   ej         d           ddd           n# 1 swxY w Y                       e          5   ej                     ddd           dS # 1 swxY w Y   dS )BTestModuleCleanUp.test_addModuleCleanup_arg_errors.<locals>.Moduler^   rg   rj   )functionr  argN)r   r   r   r	   r  r
  r   r7   r<   s   r   r  r    sB       %H%gq!gFFFF""9-- I I))7HHHHI I I I I I I I I I I I I I I""9-- , ,))+++, , , , , , , , , , , , , , , , , ,s#   AAA.BBBr  r^   rg   r  rj   )r  r	   r*   r  rq   )r<   r  r7   rc   s   ` @@r    test_addModuleCleanup_arg_errorsz2TestModuleCleanUp.test_addModuleCleanup_arg_errors~  s    	, 	, 	, 	, 	,	, 	, 	, 	, 	, 	, 	, 	,V 	, 	, 	, 	&&(((!J#89:	< 	< 	< 	< 	<r   c                    dg  G fddt                     } G fddt          j                  }d|_        |t          j        d<   t          |          }|                     ddg           |                     |j        d         d	         	                                d
         t           d           g dt          |           |                     g d           |                     t          j        j        g            d S )NTc                   F    e Zd Ze fd            Zefd            ZdS )9TestModuleCleanUp.test_run_module_cleanUp.<locals>.Modulec                                           d           t          j        t                      rt	          d          d S )NsetUpModulezsetUpModule Excr4   r	   r  r7   r   r   s   r   r  zETestModuleCleanUp.test_run_module_cleanUp.<locals>.Module.setUpModule  sI    ...)'8<<< 9%&78889 9r   c                  2                          d           d S NtearDownModuler_   r   s   r   r  zHTestModuleCleanUp.test_run_module_cleanUp.<locals>.Module.tearDownModule       011111r   Nr   r   r   staticmethodr  r  r   s   r   r  r    sb        9 9 9 9 9 \9
 2 2 2 2 \2 2 2r   r  c                   N    e Zd Ze fd            Z fdZe fd            ZdS )?TestModuleCleanUp.test_run_module_cleanUp.<locals>.TestableTestc                 2                         d           d S r   r_   r   s    r   r   zJTestModuleCleanUp.test_run_module_cleanUp.<locals>.TestableTest.setUpClass      -----r   c                 2                         d           d S r   r_   r   s    r   rW   zKTestModuleCleanUp.test_run_module_cleanUp.<locals>.TestableTest.testNothing  r   r   c                 2                         d           d S r   r_   r   s    r   r   zMTestModuleCleanUp.test_run_module_cleanUp.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   rZ   r    t        . . . . [.( ( ( ( (1 1 1 1 [1 1 1r   rZ   r  r0   r   r^   r2  z: setUpModule ExcFr  r   rw   r   r  r0   r  r	   rp   r   sysmodulesr.   rq   r   r5  r   r*   r  )r<   r  rZ   r~   r6   r5   s       @@r   test_run_module_cleanUpz)TestModuleCleanUp.test_run_module_cleanUp  sh   		2 		2 		2 		2 		2 		2 		2 		2V 		2 		2 		2	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1 #+ &H,''M>#BCCCq)!,7799"=+>>>	@ 	@ 	@ < < <	= 	= 	= 	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          ||           |                     g d           g ddt          ||           |                     g d           g ddt          ||           |                     g d           |                     t          j        j	        g            d S )NTFc                   F    e Zd Ze fd            Zefd            ZdS )CTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module1c                                           d           t          j        t                      rt	                      d S Nr  r  r   s   r   r  zOTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module1.setUpModule  sD    ...)'8<<< (%--'( (r   c                  2                          d           d S r  r_   r   s   r   r  zRTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module1.tearDownModule  r  r   Nr  r   s   r   Module1r    sb        ( ( ( ( ( \(
 2 2 2 2 \2 2 2r   r  c                   F    e Zd Ze fd            Zefd            ZdS )CTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module2c                                           d           t          j        t                      rt	                      d S )NsetUpModule2r  blowUp2r5   s   r   r  zOTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module2.setUpModule  sD    ///)'8<<< (%--'( (r   c                  2                          d           d S )NtearDownModule2r_   r   s   r   r  zRTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.Module2.tearDownModule  s     122222r   Nr  r  s   r   Module2r    sb        ( ( ( ( ( \(
 3 3 3 3 \3 3 3r   r  c                   N    e Zd Ze fd            Z fdZe fd            ZdS )HTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTestc                 2                         d           d S r   r_   r   s    r   r   zSTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest.setUpClass  r  r   c                 2                         d           d S r   r_   r   s    r   rW   zTTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest.testNothing  r   r   c                 2                         d           d S r   r_   r   s    r   r   zVTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   rZ   r    r  r   rZ   c                   N    e Zd Ze fd            Z fdZe fd            ZdS )ITestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest2c                 2                         d           d S )NsetUpClass2r_   r   s    r   r   zTTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest2.setUpClass  s    .....r   c                 2                         d           d S Ntest2r_   r   s    r   rW   zUTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest2.testNothing      (((((r   c                 2                         d           d S )NtearDownClass2r_   r   s    r   r   zWTestModuleCleanUp.test_run_multiple_module_cleanUp.<locals>.TestableTest2.tearDownClass  r  r   Nr   r   s   r   TestableTest2r    st        / / / / [/) ) ) ) )2 2 2 2 [2 2 2r   r  )r  r0   r  r  r  r  r  r0   )r  r   rw   r   r  r0   r  r0   )r  r   rw   r   r  r0   r  r  r  r  r  r0   
r  r	   rp   r   r  r  r.   rq   r*   r  )r<   r  r  rZ   r  r6   r  r5   s        @@@r    test_run_multiple_module_cleanUpz2TestModuleCleanUp.test_run_multiple_module_cleanUp  s   		2 		2 		2 		2 		2 		2 		2 		2f 		2 		2 		2		3 		3 		3 		3 		3 		3 		3 		3f 		3 		3 		3	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1	2 	2 	2 	2 	2 	2 	2H- 	2 	2 	2 #,!(I#, !(I}--- $4 $4 $4 	5 	5 	5 }--- $4 $4 $4 	5 	5 	5
 }---= = =	> 	> 	>
 	7<<<<<r   c                 .   g  G fddt                     } G fddt          j                  }d|_        |t          j        d<   t          |           |                     g d           |                     t          j        j	        g            d S )Nc                   *    e Zd Ze fd            ZdS )JTestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.Modulec                  f                          d           t          j        t                      d S r  r4   r	   r  r7   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    s8        = = = = \= = =r   r  c                   N    e Zd Ze fd            Z fdZe fd            ZdS )PTestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.TestableTestc                 2                         d           d S r   r_   r   s    r   r   z[TestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.TestableTest.setUpClass  r  r   c                 2                         d           d S r   r_   r   s    r   rW   z\TestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.TestableTest.testNothing  r   r   c                 2                         d           d S r   r_   r   s    r   r   z^TestModuleCleanUp.test_run_module_cleanUp_without_teardown.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   rZ   r    r  r   rZ   )r  r   rw   r   r0   r  )r<   r  rZ   r5   s      @r   (test_run_module_cleanUp_without_teardownz:TestModuleCleanUp.test_run_module_cleanUp_without_teardown  s    	= 	= 	= 	= 	= 	= 	=V 	= 	= 	=	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1 #+ &H $E $E $E 	F 	F 	F7<<<<<r   c                    g  G fddt                     } G fddt          j                  }d|_        |t          j        d<   t          |          }|                     |j        d         d         	                                d         t           d           |                     g d	           |                     t          j        j        g            d S )
Nc                   D    e Zd Ze fd            Ze fd            ZdS )QTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.Modulec                  f                          d           t          j        t                      d S r  r  r   s   r   r  z]TestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.Module.setUpModule  r  r   c                  L                          d           t          d          )Nr  r2   r3   r   s   r   r  z`TestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.Module.tearDownModule  s$     0111!,///r   Nr  r   s   r   r  r    s]        = = = = \= 0 0 0 0 \0 0 0r   r  c                   N    e Zd Ze fd            Z fdZe fd            ZdS )WTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.TestableTestc                 2                         d           d S r   r_   r   s    r   r   zbTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.TestableTest.setUpClass%  r  r   c                 2                         d           d S r   r_   r   s    r   rW   zcTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.TestableTest.testNothing(  r   r   c                 2                         d           d S r   r_   r   s    r   r   zeTestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception.<locals>.TestableTest.tearDownClass*  r   r   Nr   r   s   r   rZ   r  $  r  r   rZ   r   r^   r2  r3  r  r  r<   r  rZ   r~   r5   s       @r   /test_run_module_cleanUp_when_teardown_exceptionzATestModuleCleanUp.test_run_module_cleanUp_when_teardown_exception  s%   	0 	0 	0 	0 	0 	0 	0V 	0 	0 	0	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1 #+ &H,''q)!,7799"=+999	; 	; 	; $4 $4 $4 	5 	5 	5 	7<<<<<r   c                    g d G fddt                     } G fddt          j                  }d|_        |t          j        d<   t          j                            |          }|                                 | 	                    g d           | 	                    t          j
        j        g            g dt          j                            |          }|                     t                    5 }|                                 d d d            n# 1 swxY w Y   | 	                    t          |j                  d           | 	                    g d	           | 	                    t          j
        j        g            d S )
NFc                   F    e Zd Ze fd            Zefd            ZdS )DTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.Modulec                  j                         d           t          j        t                      d S Nr  r  r  r   s   r   r  zPTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.Module.setUpModule<  3    ...)'8FKKKKKKr   c                  2                          d           d S r  r_   r   s   r   r  zSTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.Module.tearDownModule@  r  r   Nr  r   s   r   r  r  ;  sh        L L L L L \L 2 2 2 2 \2 2 2r   r  c                   N    e Zd Ze fd            Z fdZe fd            ZdS )JTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.TestableTestc                 2                         d           d S r   r_   r   s    r   r   zUTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.TestableTest.setUpClassE  r  r   c                 2                         d           d S r   r_   r   s    r   rW   zVTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.TestableTest.testNothingH  r   r   c                 2                         d           d S r   r_   r   s    r   r   zXTestModuleCleanUp.test_debug_module_executes_cleanUp.<locals>.TestableTest.tearDownClassJ  r   r   Nr   r   s   r   rZ   r   D  r  r   rZ   r  Tr2   )r  r   rw   r   r  r1   )r  r	   rp   r   r  r  r#   r$   r   rq   r*   r  r
  r   r  r  r<   r  rZ   r)   r   r6   r5   s        @@r   "test_debug_module_executes_cleanUpz4TestModuleCleanUp.test_debug_module_executes_cleanUp8  s    	2 	2 	2 	2 	2 	2 	2 	2V 	2 	2 	2	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1 #+ &H*@@NN< < <	= 	= 	= 	7<<<*@@NN{++ 	rKKMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	R\**L999 $V $V $V 	W 	W 	W7<<<<<s   :DD"Dc                 V   g d G fddt                     } G fddt          j                  }d|_        |t          j        d<   t          j                            |          }|                     t                    5 }|
                                 d d d            n# 1 swxY w Y   |                     t          |j                  d           |                     g d           |                     t          j        j                   t          j        j                                         g dt          j                            |          }|                     t                    5 }|
                                 d d d            n# 1 swxY w Y   |                     t          |j                  d           |                     g d           |                     t          j        j                   t          j        j                                         d S )	NFc                   F    e Zd Ze fd            Zefd            ZdS )STestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.Modulec                  j                         d           t          j        t                      d S r  r  r   s   r   r  z_TestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.Module.setUpModulee  r  r   c                  L                          d           t          d          )Nr  TearDownModuleExcr3   r   s   r   r  zbTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.Module.tearDownModulei  s%     0111!"5666r   Nr  r   s   r   r  r  d  sh        L L L L L \L 7 7 7 7 \7 7 7r   r  c                   N    e Zd Ze fd            Z fdZe fd            ZdS )YTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.TestableTestc                 2                         d           d S r   r_   r   s    r   r   zdTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.TestableTest.setUpClasso  r  r   c                 2                         d           d S r   r_   r   s    r   rW   zeTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.TestableTest.testNothingr  r   r   c                 2                         d           d S r   r_   r   s    r   r   zgTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exception.<locals>.TestableTest.tearDownClasst  r   r   Nr   r   s   r   rZ   r  n  r  r   rZ   r  )r  r   rw   r   r  T)r  r	   rp   r   r  r  r#   r$   r
  r   r   rq   r  r  ru   r*   r  r  r  s        @@r   1test_debug_module_cleanUp_when_teardown_exceptionzCTestModuleCleanUp.test_debug_module_cleanUp_when_teardown_exceptiona  s   	7 	7 	7 	7 	7 	7 	7 	7V 	7 	7 	7	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1 #+ &H*@@NN{++ 	rKKMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	R\**,?@@@ $G $G $G 	H 	H 	H6777&,,...*@@NN{++ 	rKKMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	R\**,?@@@ $G $G $G 	H 	H 	H6777&,,.....s$   B''B+.B+6FFFc                     g fd G  fddt           j                  }                     t                    5  |                                 d d d            n# 1 swxY w Y                        t                    5  t           j                             |                       d d d            n# 1 swxY w Y   t          |                                ddddfg           d S )	Nc                  6                         | |f           d S r   r_   r`   s     r   r7   zBTestModuleCleanUp.test_addClassCleanup_arg_errors.<locals>.cleanup  r  r   c                   2    e Zd Ze fd            Zd ZdS )GTestModuleCleanUp.test_addClassCleanup_arg_errors.<locals>.TestableTestc                     |                      dddd                               t                    5  |                      d           d d d            d S # 1 swxY w Y   d S )Nr^   rg   ri   r   r  r   rj   r  )r   r
  r   )r   r7   r<   s    r   r   zRTestModuleCleanUp.test_addClassCleanup_arg_errors.<locals>.TestableTest.setUpClass  s    ##GQA1#EEE&&y11 G G''g'FFFG G G G G G G G G G G G G G G G G G   AA"Ac                     d S r   r   r@   s    r   rW   zSTestModuleCleanUp.test_addClassCleanup_arg_errors.<locals>.TestableTest.testNothing  rX   r   N)r   r   r   r   r   rW   r  s   r   rZ   r    sR        G G G G G [G    r   rZ   )r   r  r  ri   r   r  )r	   rp   r
  r   r   rs   r.   rq   r<   rZ   r7   rc   s   ` @@r   test_addClassCleanup_arg_errorsz1TestModuleCleanUp.test_addClassCleanup_arg_errors  s   	, 	, 	, 	, 	,	 	 	 	 	 	 	 	8, 	 	 	 y)) 	+ 	+((***	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+y)) 	O 	O((\\^^g(NNN	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O!!#<#<=>	@ 	@ 	@ 	@ 	@s$    A!!A%(A%*B<<C C c                     g fd G  fddt           j                  }                     t                    5   |                                             d d d            n# 1 swxY w Y                        t                    5  t           j                             |                       d d d            n# 1 swxY w Y   t          |                                ddddfg           d S )	Nc                  6                         | |f           d S r   r_   r`   s     r   r7   z=TestModuleCleanUp.test_addCleanup_arg_errors.<locals>.cleanup  r  r   c                   "    e Zd Z fdZd ZdS )BTestModuleCleanUp.test_addCleanup_arg_errors.<locals>.TestableTestc                     |                      dddd                               t                    5  |                      d           d d d            d S # 1 swxY w Y   d S )Nr^   rg   ri   r   r  r<   rj   r  )rs   r
  r   )self2r7   r<   s    r   r   zHTestModuleCleanUp.test_addCleanup_arg_errors.<locals>.TestableTest.setUp  s      !Q CCC&&y11 D D$$g7$CCCD D D D D D D D D D D D D D D D D Dr  c                     d S r   r   r@   s    r   rW   zNTestModuleCleanUp.test_addCleanup_arg_errors.<locals>.TestableTest.testNothing  rX   r   N)r   r   r   r   rW   r  s   r   rZ   r    sH        D D D D D D    r   rZ   )r<   r  r  ri   r   r!  )r	   rp   r
  r   rs   r.   rq   r  s   ` @@r   test_addCleanup_arg_errorsz,TestModuleCleanUp.test_addCleanup_arg_errors  s   	, 	, 	, 	, 	,	 	 	 	 	 	 	 	8, 	 	 	 y)) 	( 	(LNN%%'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(y)) 	P 	P((llnnw(OOO	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P!1#=#=>?	A 	A 	A 	A 	As$    A))A-0A-*CCCc                 r   g  G fddt                     } G fddt          j                  }d|_        |t          j        d<   t          |          }|                     |j        d         d         	                                d         t           d           |                     g d	           d S )
Nc                   D    e Zd Ze fd            Ze fd            ZdS )ETestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.Modulec                  f                          d           t          j        t                      d S r  r  r   s   r   r  zQTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.Module.setUpModule  r  r   c                  2                          d           d S r  r_   r   s   r   r  zTTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.Module.tearDownModule  r  r   Nr  r   s   r   r  r'    ]        = = = = \= 2 2 2 2 \2 2 2r   r  c                   N    e Zd Ze fd            Z fdZe fd            ZdS )KTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.TestableTestc                 l                         d           |                     t          d           d S r<  r  r   s    r   r   zVTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.TestableTest.setUpClass  r=  r   c                 2                         d           d S r   r_   r   s    r   rW   zWTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.TestableTest.testNothing  r   r   c                 2                         d           d S r   r_   r   s    r   r   zYTestModuleCleanUp.test_with_errors_in_addClassCleanup.<locals>.TestableTest.tearDownClass  r   r   Nr   r   s   r   rZ   r,    sy        D D D D [D( ( ( ( (1 1 1 1 [1 1 1r   rZ   r   r^   r2  r3  )r  r   rw   r   r1   r  r0   r  r	   rp   r   r  r  r.   rq   r   r5  r   r  s       @r   #test_with_errors_in_addClassCleanupz5TestModuleCleanUp.test_with_errors_in_addClassCleanup  s   	2 	2 	2 	2 	2 	2 	2V 	2 	2 	2		1 		1 		1 		1 		1 		1 		18, 		1 		1 		1 #+ &H,''q)!,7799"=+999	; 	; 	;K K K	L 	L 	L 	L 	Lr   c                 r   g  G fddt                     } G fddt          j                  }d|_        |t          j        d<   t          |          }|                     |j        d         d         	                                d         t           d           |                     g d	           d S )
Nc                   D    e Zd Ze fd            Ze fd            ZdS )@TestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.Modulec                  f                          d           t          j        t                      d S r  r  r   s   r   r  zLTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.Module.setUpModule  r  r   c                  2                          d           d S r  r_   r   s   r   r  zOTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.Module.tearDownModule  r  r   Nr  r   s   r   r  r4    r*  r   r  c                   .    e Zd Z fdZ fdZ fdZdS )FTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.TestableTestc                 l                         d           |                     t          d           d S r,  r-  r   s    r   r   zLTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.TestableTest.setUp  r.  r   c                 2                         d           d S r   r_   r   s    r   rW   zRTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.TestableTest.testNothing  r   r   c                 2                         d           d S r   r_   r   s    r   r   zOTestModuleCleanUp.test_with_errors_in_addCleanup.<locals>.TestableTest.tearDown  r   r   Nr   r   s   r   rZ   r8    se        @ @ @ @ @( ( ( ( (, , , , , , ,r   rZ   r   r^   r2  r3  )r  r   rw   r   r1   r  r0   r0  r  s       @r   test_with_errors_in_addCleanupz0TestModuleCleanUp.test_with_errors_in_addCleanup  s   	2 	2 	2 	2 	2 	2 	2V 	2 	2 	2	, 	, 	, 	, 	, 	, 	,8, 	, 	, 	, #+ &H,''q)!,7799"=+999	; 	; 	;K K K	L 	L 	L 	L 	Lr   c                    g ddd G fddt                     } G fddt          j                  }d|_        |t          j        d<   t          |          }|                     |j        d         d         	                                d         t           d	           |                     g d
           g dddt          |          }|                     |j        d         d         	                                d         t           d           |                     |j        d         d         	                                d         t           d	           |                     ddg           g dddt          |          }|                     |j        d         d         	                                d         t           d           |                     |j        d         d         	                                d         t           d	           |                     g d           g dddt          |          }|                     |j        d         d         	                                d         t           d           |                     |j        d         d         	                                d         t           d	           |                     g d           d S )NFc                   F    e Zd Ze fd            Zefd            ZdS )QTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.Modulec                                           d           t          j        t          d            rt	          d          d S )Nr  Tr  	ModuleExcr  module_blow_upr5   s   r   r  z]TestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.Module.setUpModule  sM    ...)'8DIIII! 3%k2223 3r   c                  2                          d           d S r  r_   r   s   r   r  z`TestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.Module.tearDownModule  r  r   Nr  rB  s   r   r  r?    sb        3 3 3 3 3 \3
 2 2 2 2 \2 2 2r   r  c                   \    e Zd Ze fd            ZfdZfdZefd            ZdS )WTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTestc                 T                         d           rt          d          d S )Nr   rF  r3   rG  s    r   r   zbTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTest.setUpClass	  s5    ---  2%j1112 2r   c                 T                         d           rt          d          d S rJ  r3   rL  s    r   r   z]TestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTest.setUp  rN  r   c                 2                         d           d S r   r_   r   s    r   rW   zcTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTest.testNothing  r   r   c                 2                         d           d S r   r_   r   s    r   r   zeTestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps.<locals>.TestableTest.tearDownClass  r   r   Nr1  rQ  s   r   rZ   rF    s        2 2 2 2 2 [23 3 3 3 3 3( ( ( ( (1 1 1 1 [1 1 1r   rZ   r   r^   r2  r3  )r  r   r   rw   r   r  r1   Tz: ModuleExcr  r1   rR  )r  r   r  r1   rS  )r  r   r   r   r  r1   r0  )r<   r  rZ   r~   rH  rM  rC  r5   s       @@@@r   /test_with_errors_in_addModuleCleanup_and_setUpszATestModuleCleanUp.test_with_errors_in_addModuleCleanup_and_setUps  s   		2 		2 		2 		2 		2 		2 		2 		2V 		2 		2 		2	1 	1 	1 	1 	1 	1 	1 	1 	18, 	1 	1 	1  #+ &H,''q)!,7799"=+999	; 	; 	;) ) )	* 	* 	*
 ,''q)!,7799"=+888	: 	: 	:q)!,7799"=+999	; 	; 	;M=#ABBB,''q)!,7799"=+777	9 	9 	9q)!,7799"=+999	; 	; 	; $E $E $E 	F 	F 	F ,''q)!,7799"=+888	: 	: 	:q)!,7799"=+999	; 	; 	; $3 $3 $3 	4 	4 	4 	4 	4r   c                 R   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          ||           |                     g d
           d S )Nc                  2                          d           d S r   r_   r   s   r   rd   zMTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.cleanup1I  r   r   c                  2                          d           d S r   r_   r   s   r   rh   zMTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.cleanup2L  r   r   c                  2                          d           d S r   r_   r   s   r   r   zMTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.cleanup3O  r   r   c                   F    e Zd Ze fd            Zefd            ZdS )KTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.Modulec                  Z                         d           t          j                    d S r  )r4   r	   r  rd   r5   s   r   r  zWTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.Module.setUpModuleS  s,    ...)(33333r   c                  2                          d           d S r  r_   r   s   r   r  zZTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.Module.tearDownModuleW  r  r   Nr  rS  s   r   r  rQ  R  sb        4 4 4 4 4 \4 2 2 2 2 \2 2 2r   r  c                   0    e Zd Z fdZfdZfdZdS )QTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.TestableTestc                 \                         d           |                                d S r   r   )r<   rh   r5   s    r   r   zWTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.TestableTest.setUp\  r   r   c                 2                         d           d S r   r_   r   s    r   rW   z]TestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.TestableTest.testNothing_  r   r   c                 2                         d           d S r   r_   r   s    r   r   zZTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.TestableTest.tearDowna  r   r   Nr   )rh   r5   s   r   rZ   rV  [  se        * * * * * *( ( ( ( (, , , , , , ,r   rZ   c                   0    e Zd Z fdZfdZfdZdS )VTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.OtherTestableTestc                 \                         d           |                                d S )NsetUp2r   r   s    r   r   z\TestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.OtherTestableTest.setUpe  s-    ))))))))r   c                 2                         d           d S r  r_   r   s    r   rW   zbTestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.OtherTestableTest.testNothingh  r  r   c                 2                         d           d S )N	tearDown2r_   r   s    r   r   z_TestModuleCleanUp.test_module_cleanUp_with_multiple_classes.<locals>.OtherTestableTest.tearDownj  s    ,,,,,r   Nr   )r   r5   s   r   OtherTestableTestr[  d  se        * * * * * *) ) ) ) )- - - - - - -r   ra  )r  r   rw   r   rh   r]  r  r`  r   r  rd   )r  r	   rp   r   r  r  r.   rq   )r<   r  rZ   ra  rd   rh   r   r5   s       @@@@r   )test_module_cleanUp_with_multiple_classesz;TestModuleCleanUp.test_module_cleanUp_with_multiple_classesG  sr   	( 	( 	( 	( 	(	( 	( 	( 	( 	(	( 	( 	( 	( 	(	2 	2 	2 	2 	2 	2 	2 	2V 	2 	2 	2	, 	, 	, 	, 	, 	, 	, 	,8, 	, 	, 	,	- 	- 	- 	- 	- 	- 	- 	- 1 	- 	- 	- #+'/$ &H0111D D D	E 	E 	E 	E 	Er   c                 N   g }t          j        |j        d           t          |d          }|                     t          j        |          d           t          j        |j        d           t           j                                         |                     |g d           d S )Nrd   r   rh   r   )r	   r  r4   r9   rq   enterModuleContextr*   r  )r<   rc   r   s      r   test_enterModuleContextz)TestModuleCleanUp.test_enterModuleContextv  s    !(/:>>>Hb!!4R88"===!(/:>>>&&(((#L#L#LMMMMMr   c                 r    G d dt           j                  }|                     t          d          5  t          j        t                                 d d d            n# 1 swxY w Y   |                     t          d          5  t          j        t                                 d d d            n# 1 swxY w Y   |                     t          d          5  t          j        t                                 d d d            n# 1 swxY w Y   |                     t           j	        j
        g            d S )Nc                       e Zd Zd ZdS )JTestModuleCleanUp.test_enterModuleContext_arg_errors.<locals>.TestableTestc                     d S r   r   r@   s    r   rW   zVTestModuleCleanUp.test_enterModuleContext_arg_errors.<locals>.TestableTest.testNothing  rX   r   NrY   r   r   r   rZ   rh    r[   r   rZ   r   )r	   rp   r   r   rd  rH   rJ   rO   rq   r*   r  rg  s     r   "test_enterModuleContext_arg_errorsz4TestModuleCleanUp.test_enterModuleContext_arg_errors  s   	 	 	 	 	8, 	 	 	 ##I/DEE 	= 	='(9(;(;<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=##I/DEE 	6 	6'
555	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6##I/DEE 	5 	5'	444	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	7<<<<<s5   !A!!A%(A%!B44B8;B8!DDDN)r   r   r   r  r  r  r  r  r  r  r  r  r  r$  r1  r<  rK  rb  re  rj  r   r   r   r  r  O  s3       = = =0= = =,< < <%= %= %=NI= I= I=V= = =2= = =@'= '= '=R+/ +/ +/Z@ @ @,A A A*L L LBL L L<M4 M4 M4^-E -E -E^	N 	N 	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 ej                    d             Zd Zd ZdS )Test_TextTestRunnerc                 z    t           j                            d          | _        | j        rt           j        d= d S d S NPYTHONWARNINGS)osenvirongetpythonwarningsr@   s    r   r   zTest_TextTestRunner.setUp  sA     !jnn-=>> 	-
+,,,	- 	-r   c                 @    | j         r| j         t          j        d<   d S d S rn  )rs  rp  rq  r@   s    r   r   zTest_TextTestRunner.tearDown  s-     	?+/+>BJ'(((	? 	?r   c                    t          j                    }|                     |j                   |                     |j                   |                     |j        d           |                     |j        d            |                     |j	                   |                     |j
        t           j                   |                     |j                   d S r]   )r	   r   r   failfastbufferrq   	verbositywarningsru   descriptionsr   TextTestResult	tb_locals)r<   r,   s     r   	test_initzTest_TextTestRunner.test_init  s    (**)))''')1---$///+,,,+X-DEEE)*****r   c                      G fddt           j                   G d dt           j                  } |d d d           d S )Nc                   "     e Zd Z fdZ xZS )>Test_TextTestRunner.test_multiple_inheritance.<locals>.AResultc                 R    t          |                               |||           d S r   )superr=   )r<   r   rz  rx  AResult	__class__s       r   r=   zGTest_TextTestRunner.test_multiple_inheritance.<locals>.AResult.__init__  s+    gt$$--flINNNNNr   )r   r   r   r=   __classcell__)r  r  s   @r   r  r    sH        O O O O O O O O O Or   r  c                       e Zd ZdS )BTest_TextTestRunner.test_multiple_inheritance.<locals>.ATextResultNr   r   r   r   ATextResultr    s        Dr   r  r^   )r	   r
   r{  )r<   r  r  s     @r   test_multiple_inheritancez-Test_TextTestRunner.test_multiple_inheritance  s    	O 	O 	O 	O 	O 	O 	Oh) 	O 	O 	O	 	 	 	 	(17 	 	 	
 	D$"""""r   c                 f    G d dt           j                  }t          j                    t          j        t	          j                    dd          }fd|_        |                     |d                     |                     j	                   |                     j
                   d S )Nc                       e Zd Zd ZdS )7Test_TextTestRunner.testBufferAndFailfast.<locals>.Testc                     d S r   r   r@   s    r   testFooz?Test_TextTestRunner.testBufferAndFailfast.<locals>.Test.testFoo  rX   r   Nr   r   r   r  r   r   r   Testr    r[   r   r  T)r   rv  rw  c                       S r   r   r}   s   r   <lambda>z;Test_TextTestRunner.testBufferAndFailfast.<locals>.<lambda>      V r   r  )r	   rp   r
   r   r   r   _makeResultr'   ru   rv  rw  )r<   r  r,   r~   s      @r   testBufferAndFailfastz)Test_TextTestRunner.testBufferAndFailfast  s    	 	 	 	 	8$ 	 	 	 $&&(046 6 6 ,^^^

44	??###(((&&&&&r   c                     t          j        t          j                    d          }|                    t          j                              }|                     d|j                   d S )NT)r   r|  )r	   r   r   r   r'   r"   rq   r|  )r<   r,   r~   s      r   test_localszTest_TextTestRunner.test_locals  sV    (NNNH.0011v/00000r   c                      G d dt           j                  }t           j        j        fd}                     |           t          j                    t          j        t          j                              }fd|_	        d _
         fd}|t           j        _        |                    t          j                                                     j
        d           d S )	Nc                       e Zd Zd ZdS );Test_TextTestRunner.testRunnerRegistersResult.<locals>.Testc                     d S r   r   r@   s    r   r  zCTest_TextTestRunner.testRunnerRegistersResult.<locals>.Test.testFoo  rX   r   Nr  r   r   r   r  r    r[   r   r  c                  *     t           j        _        d S r   )r	   r,   registerResult)originalRegisterResults   r   r7   z>Test_TextTestRunner.testRunnerRegistersResult.<locals>.cleanup  s    -CHO***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_                             |            d S r]   )wasRegisteredrq   )
thisResultr~   r<   s    r   fakeRegisterResultzITest_TextTestRunner.testRunnerRegistersResult.<locals>.fakeRegisterResult  s3    !#Z00000r   r^   )r	   rp   r,   r  rs   r
   r   r   r   r  r  r'   r"   rq   )r<   r  r7   r,   r  r  r~   s   `    @@r   testRunnerRegistersResultz-Test_TextTestRunner.testRunnerRegistersResult  s   	 	 	 	 	8$ 	 	 	 "*!?	D 	D 	D 	D 	D   $&&(>>>+^^^	1 	1 	1 	1 	1 	1 *<&

8%''(((+Q/////r   c                      G d dt                      G fddt          j                               }|                    t          j                               d S )Nc                       e Zd ZdZd ZdS )bTest_TextTestRunner.test_works_with_result_without_startTestRun_stopTestRun.<locals>.OldTextResultr    c                     d S r   r   r@   s    r   printErrorsznTest_TextTestRunner.test_works_with_result_without_startTestRun_stopTestRun.<locals>.OldTextResult.printErrors  rX   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                 p    t          |                               t          j                               d S 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    sW        < < < < < <' ' ' ' ' ' ' ' '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 } |          }|                    t          j                               ddg}|                     ||           d S )Nc                       e Zd ZdZd ZdS )STest_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingTextResultr    c                     d S r   r   r@   s    r   r  z_Test_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingTextResult.printErrors  rX   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                 ~    t          |                               t          j                               || _        d S r   )r  r=   r   r   _events)r<   eventsLoggingRunnerr  s     r   r=   zXTest_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingRunner.__init__  s2    mT**33BKMMBBB%r   c                 $     | j                   S r   )r  )r<   r  s    r   r  z[Test_TextTestRunner.test_startTestRun_stopTestRun_called.<locals>.LoggingRunner._makeResult  s    ((666r   r  )r  r  r  s   @r   r  r    sW        & & & & & &7 7 7 7 7 7 7 7 7r   r  startTestRunstopTestRun)r   r	   r   r'   r"   rq   )r<   r  r,   expectedr  r  s       @@r   $test_startTestRun_stopTestRun_calledz8Test_TextTestRunner.test_startTestRun_stopTestRun_called  s    	 	 	 	 	 	 	 	
	7 	7 	7 	7 	7 	7 	7 	7H3 	7 	7 	7 v&&

8%''((("M2*****r   c                 f   t          j        d          }t          j        |          }t	          dt
          j        dz             D ]j}t          j        ||          }t          j        |          }| 	                    |j
                                        |                                           kd S )Nr   rg   r^   )r   r   r	   r   rangepickleHIGHEST_PROTOCOLdumpsloadsrq   r   getvalue)r<   r   r,   protocolsobjs         r   test_pickle_unpicklez(Test_TextTestRunner.test_pickle_unpickle  s     U##(00a!81!<== 	G 	GHVX..A,q//CSZ0022FOO4E4EFFFF		G 	Gr   c                 *   d }t                      }t                      }t                      }t          j        ||||          }|                     |j        |           |j        ||f}|                     |                                |           d S )Nc                      | S r   r   )ra   s    r   MockResultClassz=Test_TextTestRunner.test_resultclass.<locals>.MockResultClass  s    Kr   )r   )r  r	   r   rq   r   r   r  )r<   r  STREAMDESCRIPTIONS	VERBOSITYr,   expectedresults          r   test_resultclassz$Test_TextTestRunner.test_resultclass  s    	 	 	xxHH	(y5DF F F+_=== -yA++--~>>>>>r   c                 j   	 d }t          t          j        t          j        t          j                            t                              }d}d}t          j        t          j	        ddgfi |}|5   ||          \  }}d d d            n# 1 swxY w Y   | 
                    d|           |                     t          |          d           d	D ]+}|                     |                    |          d
           ,||dfD ]+}|                     |                    |          d           ,t          j	        ddgt          j	        dddgt          j	        ddgf}	|	D ]u}
t          j        |
fi |}|5   ||          \  }}d d d            n# 1 swxY w Y   | 
                    d|           |                     t          |          d           vt          j        t          j	        ddgfi |}|5   ||          \  }}d d d            n# 1 swxY w Y   | 
                    d|           |                     t          |          d           dD ]+}|                     |                    |          d
           ,||fD ]+}|                     |                    |          d           ,d S )Nc                 >    d |                                  D             S )Nc                 6    g | ]}|                                 S r   )r5  ).0bs     r   
<listcomp>zPTest_TextTestRunner.test_warnings.<locals>.get_parse_out_err.<locals>.<listcomp>$  s     <<<qALLNN<<<r   )communicate)ps    r   get_parse_out_errz<Test_TextTestRunner.test_warnings.<locals>.get_parse_out_err#  s    <<AMMOO<<<<r   )stdoutstderrcwds   Please use assertEqual instead.s   Please use assertTrue instead.z-Ez_test_warnings.pys   OK   )   dw   iw   uwri      rwr^   ignorez-Waz-Wir   always   )r  r  r  r  )rt   
subprocessPIPErp  pathdirname__file__Popenr  
executabler   rq   r   count)r<   r  optsae_msgat_msgr  outerrmsg	args_listra   s              r   test_warningsz!Test_TextTestRunner.test_warnings  s   		= 	= 	=:?:?113 3 332 cnd4GHQQDQQ 	, 	,((++HC	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,eS!!!S2&&&( 	0 	0CSYYs^^Q////FE* 	0 	0CSYYs^^Q//// ^0(;^U$7B^U$78
	  	* 	*D ....A 0 0,,Q//S0 0 0 0 0 0 0 0 0 0 0 0 0 0 0MM%%%%SXXq))))
 cn.A8L % %#% % 	, 	,((++HC	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,eS!!!S2&&&/ 	0 	0CSYYs^^Q////F# 	0 	0CSYYs^^Q////	0 	0s6   2BBB5FF	F	6HHHc                     t           j        }t          j                    }|t           _        	 t	          j                    }|                     |j        j        |u            |t           _        d S # |t           _        w xY wr   )r  r  r   r   r	   r   ru   r   )r<   
old_stderrfr,   s       r   %testStdErrLookedUpAtInstantiationTimez9Test_TextTestRunner.testStdErrLookedUpAtInstantiationTimeU  sh    Z
KMM
	$,..FOOFM0A5666#CJJJCJ####s   4A/ /A=c                     t          j                    }t          j        |          }|                     |j        j        |u            d S r   )r   r   r	   r   ru   r   )r<   r  r,   s      r   testSpecifiedStreamUsedz+Test_TextTestRunner.testSpecifiedStreamUsed`  s?    KMM(++,122222r   N)r   r   r   r   r   r}  r  r  r  r  r  r  r  r  r   requires_subprocessr  r  r  r   r   r   rl  rl    s       #- - -? ? ?
+ + +
# 
# 
#' ' '1 1 1
0 0 0.) ) ) + + +(	G 	G 	G? ? ? !W ""70 70 #"70r	$ 	$ 	$3 3 3 3 3r   rl  )F)r   rp  r  r  r  rw   r   r	   unittest.caser   unittest.test.supportr   r   r   r   	Exceptionr   r   r   r.   r7   r9   rH   rJ   rO   rp   rR   r   r  rl  mainr   r   r   <module>r     s   				 				 



             " " " " " "H H H H H H H H! ! !9 9 9
	 	 	 	 	) 	 	 	 (0:'='=X^^2RRR! ! !"( ( ( (
% 
% 
% 
% 
% 
% 
% 
%	 	 	 	 	 	 	 	              
g- g- g- g- g-(# g- g- g-TS4 S4 S4 S4 S4x( S4 S4 S4l
~= ~= ~= ~= ~=) ~= ~= ~=BT3 T3 T3 T3 T3(+ T3 T3 T3n zHMOOOOO r   