
    =eP;                         d dl Z d dlZd dlZd dlZd dlmZmZ  G d de          Zd Z	 G d de j
        e          Zedk    r e j                     dS dS )	    N)LoggingResultTestEqualityc                   4    e Zd Z G d dej                  ZdS )Testc                   &    e Zd Zd Zd Zd Zd ZdS )Test.Fooc                     d S N selfs    //usr/lib/python3.11/unittest/test/test_suite.pytest_1zTest.Foo.test_1             c                     d S r
   r   r   s    r   test_2zTest.Foo.test_2   r   r   c                     d S r
   r   r   s    r   test_3zTest.Foo.test_3   r   r   c                     d S r
   r   r   s    r   runTestzTest.Foo.runTest   r   r   N)__name__
__module____qualname__r   r   r   r   r   r   r   Foor      s4        r   r   N)r   r   r   unittestTestCaser   r   r   r   r   r      sA                 h          r   r   c                  >    t          j        d | D                       S )Nc              3   J   K   | ]}t                               |          V  d S r
   )r   r   ).0ns     r   	<genexpr>z _mk_TestSuite.<locals>.<genexpr>   s,      99adhhqkk999999r   )r   	TestSuite)namess    r   _mk_TestSuiter%      s"    995999999r   c                      e Zd Z ej                     ej                    f ej                     ej        g           f ed           ed          fgZ ej                     ed          f ej        g            ed          f edd           edd          f ed           ed          fg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 Zd Zd Zd Zd Zd Zd Z d Z!d Z"dS ) Test_TestSuiter   r   r   c                    t          j                    }|                     |                                d           |                    t          j                               |                     |                                d           d S Nr   r   r#   assertEqualcountTestCasesrun
TestResultr   suites     r   test_init__tests_optionalz(Test_TestSuite.test_init__tests_optional2   su    "$$--//333		(%''(((--//33333r   c                    t          j        g           }|                     |                                d           |                    t          j                               |                     |                                d           d S r)   r*   r/   s     r   test_init__empty_testsz%Test_TestSuite.test_init__empty_testsA   sw    "2&&--//333		(%''(((--//33333r   c                 r   d }t          j         |                      }|                     |                                d           t          j        |          }|                     |                                d           t          j        t	          |                    }|                     |                                d           |                    t          j                               |                     |                                d           |                    t          j                               |                     |                                d           |                    t          j                               |                     |                                d           d S )Nc               3   f   K   t          j        d           V  t          j        d           V  d S )Nc                      d S r
   r   r   r   r   <lambda>zRTest_TestSuite.test_init__tests_from_any_iterable.<locals>.tests.<locals>.<lambda>Q       D r   c                      d S r
   r   r   r   r   r7   zRTest_TestSuite.test_init__tests_from_any_iterable.<locals>.tests.<locals>.<lambda>R   r8   r   )r   FunctionTestCaser   r   r   testsz@Test_TestSuite.test_init__tests_from_any_iterable.<locals>.testsP   s>      +LL99999+LL9999999r      )r   r#   r+   r,   setr-   r.   )r   r;   suite_1suite_2suite_3s        r   "test_init__tests_from_any_iterablez1Test_TestSuite.test_init__tests_from_any_iterableO   st   	: 	: 	: $UUWW--//111555$W--//111555$S\\22//111555 	H'))***//111555H'))***//111555H'))***//11155555r   c                 0   d }t          j         |                      }|                     |                                d           |                    t          j                               |                     |                                d           d S )Nc               3      K   t          j        d           } t          j        | g          V  t          j        d           V  d S )Nc                      d S r
   r   r   r   r   r7   zWTest_TestSuite.test_init__TestSuite_instances_in_tests.<locals>.tests.<locals>.<lambda>n   r8   r   c                      d S r
   r   r   r   r   r7   zWTest_TestSuite.test_init__TestSuite_instances_in_tests.<locals>.tests.<locals>.<lambda>p   r8   r   )r   r:   r#   )ftcs    r   r;   zETest_TestSuite.test_init__TestSuite_instances_in_tests.<locals>.testsm   sP      +LL99C$cU++++++LL9999999r   r<   r*   )r   r;   r0   s      r   'test_init__TestSuite_instances_in_testsz6Test_TestSuite.test_init__TestSuite_instances_in_testsl   s    	: 	: 	:
 "5577++--//333		(%''(((--//33333r   c                     t          j        d           }t          j        d           }t          j        ||f          }|                     t	          |          ||g           d S )Nc                      d S r
   r   r   r   r   r7   z*Test_TestSuite.test_iter.<locals>.<lambda>}       $ r   c                      d S r
   r   r   r   r   r7   z*Test_TestSuite.test_iter.<locals>.<lambda>~   rJ   r   )r   r:   r#   r+   listr   test1test2r0   s       r   	test_iterzTest_TestSuite.test_iter|   s`    ),,77),,77"E5>22euen55555r   c                 |    t          j                    }|                     |                                d           d S r)   )r   r#   r+   r,   r/   s     r   test_countTestCases_zero_simplez.Test_TestSuite.test_countTestCases_zero_simple   s8    "$$--//33333r   c                      G d dt           j                  }t          j        t          j                    g          }|                     |                                d           d S )Nc                       e Zd Zd ZdS )=Test_TestSuite.test_countTestCases_zero_nested.<locals>.Test1c                     d S r
   r   r   s    r   testzBTest_TestSuite.test_countTestCases_zero_nested.<locals>.Test1.test       r   Nr   r   r   rW   r   r   r   Test1rU      #            r   rZ   r   )r   r   r#   r+   r,   )r   rZ   r0   s      r   test_countTestCases_zero_nestedz.Test_TestSuite.test_countTestCases_zero_nested   su    	 	 	 	 	H% 	 	 	 "H$6$8$8#9::--//33333r   c                 r   t          j        d           }t          j        d           }t          j        ||f          }|                     |                                d           |                    t          j                               |                     |                                d           d S )Nc                      d S r
   r   r   r   r   r7   z;Test_TestSuite.test_countTestCases_simple.<locals>.<lambda>   rJ   r   c                      d S r
   r   r   r   r   r7   z;Test_TestSuite.test_countTestCases_simple.<locals>.<lambda>   rJ   r   r<   )r   r:   r#   r+   r,   r-   r.   rM   s       r   test_countTestCases_simplez)Test_TestSuite.test_countTestCases_simple   s    ),,77),,77"E5>22--//333		(%''(((--//33333r   c                 D    G d dt           j                  }t          j        d           }t          j        d           }t          j         |d          |f          }t          j        || |d          f          }|                     |                                d           |                    t          j                               |                     |                                d           |                     |                                d           d S )	Nc                       e Zd Zd Zd ZdS )8Test_TestSuite.test_countTestCases_nested.<locals>.Test1c                     d S r
   r   r   s    r   rN   z>Test_TestSuite.test_countTestCases_nested.<locals>.Test1.test1   r   r   c                     d S r
   r   r   s    r   rO   z>Test_TestSuite.test_countTestCases_nested.<locals>.Test1.test2   r   r   N)r   r   r   rN   rO   r   r   r   rZ   rc      s"        !!!!!!!!r   rZ   c                      d S r
   r   r   r   r   r7   z;Test_TestSuite.test_countTestCases_nested.<locals>.<lambda>   rJ   r   c                      d S r
   r   r   r   r   r7   z;Test_TestSuite.test_countTestCases_nested.<locals>.<lambda>   rJ   r   rO   rN      r<   )r   r   r:   r#   r+   r,   r-   r.   )r   rZ   rO   test3childparents         r   test_countTestCases_nestedz)Test_TestSuite.test_countTestCases_nested   s   	" 	" 	" 	" 	"H% 	" 	" 	" ),,77),,77"EE'NNE#:;;#UE55>>$BCC..00!444

8&(()))..00!444--//33333r   c                     g }t          |          }t          j                    }|                    |           |                     |g            d S r
   )r   r   r#   r-   r+   )r   eventsresultr0   s       r   test_run__empty_suitez$Test_TestSuite.test_run__empty_suite   sP    v&&"$$		&$$$$$r   c                     t          j                    }	 |                                 |                     d           d S # t          $ r Y d S w xY w)NFailed to raise TypeError)r   r#   r-   fail	TypeErrorr/   s     r   test_run__requires_resultz(Test_TestSuite.test_run__requires_result   sa    "$$	3IIKKK II122222  	 	 	DD	s   A   
AAc                    g t                    } G fddt          j                  } |d           |d          g}t          j        |                              |           |                     ddg           d S )Nc                   &    e Zd Z fdZd Zd ZdS ),Test_TestSuite.test_run.<locals>.LoggingCasec                 B                         d| j        z             d S )Nzrun %s)append_testMethodName)r   ro   rn   s     r   r-   z0Test_TestSuite.test_run.<locals>.LoggingCase.run   s#    h)==>>>>>r   c                     d S r
   r   r   s    r   rN   z2Test_TestSuite.test_run.<locals>.LoggingCase.test1   r   r   c                     d S r
   r   r   s    r   rO   z2Test_TestSuite.test_run.<locals>.LoggingCase.test2   r   r   N)r   r   r   r-   rN   rO   )rn   s   r   LoggingCaserx      s>        ? ? ? ? ? "!!!!!!!r   r~   rN   rO   z	run test1z	run test2)r   r   r   r#   r-   r+   )r   ro   r~   r;   rn   s       @r   test_runzTest_TestSuite.test_run   s    v&&	" 	" 	" 	" 	" 	" 	"(+ 	" 	" 	" W%%{{7';';<5!!%%f---+{!;<<<<<r   c                     G d dt           j                  } |d          }t          j                    }|                    |           |                     |                                d           |                     t          |          |g           |                    t          j                               |                     |                                d           d S )Nc                       e Zd Zd ZdS )2Test_TestSuite.test_addTest__TestCase.<locals>.Fooc                     d S r
   r   r   s    r   rW   z7Test_TestSuite.test_addTest__TestCase.<locals>.Foo.test   r   r   NrY   r   r   r   r   r                   r   r   rW      	r   r   r#   addTestr+   r,   rL   r-   r.   )r   r   rW   r0   s       r   test_addTest__TestCasez%Test_TestSuite.test_addTest__TestCase   s    	! 	! 	! 	! 	!(# 	! 	! 	! s6{{"$$d--//333etf---		(%''(((--//33333r   c                     G d dt           j                  }t          j         |d          g          }t          j                    }|                    |           |                     |                                d           |                     t          |          |g           |                    t          j                               |                     |                                d           d S )Nc                       e Zd Zd ZdS )3Test_TestSuite.test_addTest__TestSuite.<locals>.Fooc                     d S r
   r   r   s    r   rW   z8Test_TestSuite.test_addTest__TestSuite.<locals>.Foo.test   r   r   NrY   r   r   r   r   r      r   r   r   rW   r   r   )r   r   r?   r0   s       r   test_addTest__TestSuitez&Test_TestSuite.test_addTest__TestSuite   s    	! 	! 	! 	! 	!(# 	! 	! 	! $cc&kk]33"$$g--//333ewi000		(%''(((--//33333r   c                     G d dt           j                  } |d           |d          t          j        g          fd}t          j                    }|                     |                       |                     t          |          t           |                                 t          j                    } |            D ]}|                    |           |                     ||           d S )Nc                       e Zd Zd Zd ZdS ))Test_TestSuite.test_addTests.<locals>.Fooc                     d S r
   r   r   s    r   r   z0Test_TestSuite.test_addTests.<locals>.Foo.test_1  r   r   c                     d S r
   r   r   s    r   r   z0Test_TestSuite.test_addTests.<locals>.Foo.test_2  r   r   N)r   r   r   r   r   r   r   r   r   r     s"        """"""""r   r   r   r   c               3   $   K   V  V   V  d S r
   r   )inner_suiter   r   s   r   genz)Test_TestSuite.test_addTests.<locals>.gen  s+      LLLLLLr   )r   r   r#   addTestsr+   rL   r   )	r   r   r   r>   r?   tr   r   r   s	         @@@r   test_addTestszTest_TestSuite.test_addTests  s+   	# 	# 	# 	# 	#(# 	# 	# 	# XX(&22	 	 	 	 	 	 	
 $&&gSSUU444 $&& 	 	AOOA'*****r   c                     t          j                    }	 |                    d           |                     d           d S # t          $ r Y d S w xY w)N   rr   )r   r#   r   rs   rt   r/   s     r   test_addTest__noniterablez(Test_TestSuite.test_addTest__noniterable/  sf    "$$	3NN1 II122222  	 	 	DD	s   A 
AAc                 n    t          j                    }|                     t          |j        d           d S )Nr   )r   r#   assertRaisesrt   r   r/   s     r   test_addTest__noncallablez(Test_TestSuite.test_addTest__noncallable9  s0    "$$)U]A66666r   c                     t          j                    }|                     t          |j        t
                     |                     t          |j        t           j                   d S r
   )r   r#   r   rt   r   r'   r/   s     r   test_addTest__casesuiteclassz+Test_TestSuite.test_addTest__casesuiteclass=  sM    "$$)U]NCCC)U]H4FGGGGGr   c                 n    t          j                    }|                     t          |j        d           d S )Nfoo)r   r#   r   rt   r   r/   s     r   test_addTests__stringz$Test_TestSuite.test_addTests__stringB  s0    "$$)U^U;;;;;r   c                     d }t          j                    }|                    |           |                    t          j                               d S )Nc                     d S r
   r   )_s    r   fz0Test_TestSuite.test_function_in_suite.<locals>.fG  s    Dr   )r   r#   r   r-   r.   )r   r   r0   s      r   test_function_in_suitez%Test_TestSuite.test_function_in_suiteF  sT    	 	 	"$$a 			(%''(((((r   c                     t           j        j        st          j        d          t          j                    }g d|_        |                    d           |                     g d|j                   d S )NSuite cleanup is disabled)r   r<      r   )r   Nr   )r   BaseTestSuite_cleanupSkipTestr#   _tests_removeTestAtIndexr+   r/   s     r   test_remove_test_at_indexz(Test_TestSuite.test_remove_test_at_indexO  sr    %. 	A#$?@@@"$$ yy  ###u|44444r   c                     t           j        j        st          j        d          t          j                    }d |_        |                    d           d S )Nr   r<   )r   r   r   r   r#   r   r   r/   s     r   'test_remove_test_at_index_not_indexablez6Test_TestSuite.test_remove_test_at_index_not_indexableZ  sT    %. 	A#$?@@@"$$ 	  #####r   c                    t           j        j        st          j        d           G d dt           j                  } |d          }t          j        |          } | |            g          }|                    t          j                               ~t          j
                     |                     |j        d g           |                      |                       d S )Nr   c                       e Zd Zd ZdS )ATest_TestSuite.assert_garbage_collect_test_after_run.<locals>.Fooc                     d S r
   r   r   s    r   test_nothingzNTest_TestSuite.assert_garbage_collect_test_after_run.<locals>.Foo.test_nothingi  rX   r   N)r   r   r   r   r   r   r   r   r   h  r[   r   r   r   )r   r   r   r   r   weakrefrefr-   r.   gccollectr+   r   assertIsNone)r   TestSuiteClassr   rW   wrefr0   s         r   %assert_garbage_collect_test_after_runz4Test_TestSuite.assert_garbage_collect_test_after_rund  s    %. 	A#$?@@@	 	 	 	 	(# 	 	 	 s>""{4  x((		(%''((( 	
v...$$&&!!!!!r   c                 D    |                      t          j                   d S r
   )r   r   r   r   s    r   1test_garbage_collect_test_after_run_BaseTestSuitez@Test_TestSuite.test_garbage_collect_test_after_run_BaseTestSuitez  s    2283IJJJJJr   c                 D    |                      t          j                   d S r
   )r   r   r#   r   s    r   -test_garbage_collect_test_after_run_TestSuitez<Test_TestSuite.test_garbage_collect_test_after_run_TestSuite}  s    2283EFFFFFr   c                     G d dt           j                  } G fddt                    d|_        t          j        d<   |                     t          j        j        d           t          j                    }|	                     |d           |d          g           | 
                    |                                d           t          j                    }|                    |           |                     j                   |                     j                   |                     |j                   |                     |j                   | 
                    t#          |j                  d           | 
                    t#          |j                  d	           | 
                    |j        d           | 
                    |                                d           d S )
Nc                   N    e Zd ZdZdZed             Zed             Zd Zd Z	dS )/Test_TestSuite.test_basetestsuite.<locals>.TestFc                     d| _         d S NTwasSetUpclss    r   
setUpClassz:Test_TestSuite.test_basetestsuite.<locals>.Test.setUpClass  s    #r   c                     d| _         d S r   wasTornDownr   s    r   tearDownClassz=Test_TestSuite.test_basetestsuite.<locals>.Test.tearDownClass  s    "&r   c                     d S r
   r   r   s    r   testPassz8Test_TestSuite.test_basetestsuite.<locals>.Test.testPass  rX   r   c                     t            d S r
   )rs   r   s    r   testFailz8Test_TestSuite.test_basetestsuite.<locals>.Test.testFail  s    r   N)
r   r   r   r   r   classmethodr   r   r   r   r   r   r   r   r     sn        HK$ $ [$' ' ['      r   r   c                   L    e Zd ZdZdZe fd            Ze fd            ZdS )1Test_TestSuite.test_basetestsuite.<locals>.ModuleFc                      d _         d S r   r   Modules   r   setUpModulez=Test_TestSuite.test_basetestsuite.<locals>.Module.setUpModule  s    "&r   c                      d _         d S r   r   r   s   r   tearDownModulez@Test_TestSuite.test_basetestsuite.<locals>.Module.tearDownModule  s    %)"""r   N)r   r   r   r   r   staticmethodr   r   r   s   r   r   r     se        HK' ' ' ' \'* * * * \* * *r   r   r   r   r<   r   r   )r   r   objectr   sysmodules
addCleanuppopr   r   r+   r,   r.   r-   assertFalser   r   lenerrorsfailurestestsRun)r   r   r0   ro   r   s       @r   test_basetestsuitez!Test_TestSuite.test_basetestsuite  s   	 	 	 	 	8$ 	 	 		* 	* 	* 	* 	* 	* 	*V 	* 	* 	* # &H222&((Z(($$z*:*:;<<<--//333$&&		&)))+,,,''')***V]++Q///V_--q111!,,,--//33333r   c                 >    G d dt           j                  } |            }t          j                    }t          j                    }|                    |            ||           |                     |j                   |                     |j                   d S )Nc                       e Zd ZdZd ZdS )4Test_TestSuite.test_overriding_call.<locals>.MySuiteFc                 H    d| _         t          j        j        | g|R i | d S r   )calledr   r#   __call__)r   argskws      r   r   z=Test_TestSuite.test_overriding_call.<locals>.MySuite.__call__  s3    ""+D>4>>>2>>>>>r   N)r   r   r   r   r   r   r   r   MySuiter     s(        F? ? ? ? ?r   r   )r   r#   r.   r   
assertTruer   r   _testRunEntered)r   r   r0   ro   wrappers        r   test_overriding_callz#Test_TestSuite.test_overriding_call  s    	? 	? 	? 	? 	?h( 	? 	? 	? 		$&&$&&%%% 	/00000r   N)#r   r   r   r   r#   r%   eq_pairsne_pairsr1   r3   rA   rG   rP   rR   r\   r`   rl   rp   ru   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r'   r'      s        $#%%'9x'9';';<##%%'9x'9"'='=>x((--*A*ABDH
 $#%%}}X'>'>?##B''x)@)@Ax22MM(H4U4UVx((--*A*ABDH4 4 44 4 46 6 6:
4 
4 
4 6 6 64 4 44 4 44 4 44 4 4(% % %3 3 3= = =$4 4 4 4 4 4(+ + +>3 3 37 7 7H H H
< < <) ) )	5 	5 	5$ $ $" " ",K K KG G G)4 )4 )4X1 1 1 1 1r   r'   __main__)r   r   r   r   unittest.test.supportr   r   r   r   r%   r   r'   r   mainr   r   r   <module>r      s     				 



  = = = = = = = =         6      : : :b1 b1 b1 b1 b1X& b1 b1 b1J zHMOOOOO r   