HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/unittest/test/__pycache__/test_result.cpython-37.opt-2.pyc
B

"��g�a�@s�ddlZddlZddlZddlmZddlZddlZGdd�de�Zdd�Z	Gdd�dej
�Zeej
j�Zxd	D]
Zee=qpWdd
d�Zeed<edefe�ZGd
d�dej
�ZGdd�dej
�Zedkr�e��dS)�N)�supportc@seZdZGdd�d�ZdS)�
MockTracebackc@seZdZdd�Zdd�ZdS)z MockTraceback.TracebackExceptioncOs|�dd�|_dS)N�capture_localsF)�getr)�self�args�kwargs�r	�5/usr/local/lib/python3.7/unittest/test/test_result.py�__init__
sz)MockTraceback.TracebackException.__init__cCsdg}|jr|�d�|S)NzA traceback�locals)r�append)r�resultr	r	r
�formats
z'MockTraceback.TracebackException.formatN)�__name__�
__module__�__qualname__rrr	r	r	r
�TracebackExceptionsrN)rrrrr	r	r	r
rsrcCsttj_dS)N)�	traceback�unittestrr	r	r	r
�restore_tracebacksrc@seZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Ze�ejjd!kd"�d#d$��Ze�ejjd!kd"�d%d&��Ze�ejjd!kd"�d'd(��Ze�ejjd!kd"�d)d*��Zd+d,�Zd-d.�Zd/d0�Zd1S)2�Test_TestResultcCsrt��}|�|���|�t|j�d�|�t|j�d�|�|jd�|�|j	d�|�
|j�|�
|j�dS)NrF)
r�
TestResult�
assertTrue�
wasSuccessful�assertEqual�len�errors�failures�testsRun�
shouldStopZassertIsNoneZ_stdout_bufferZ_stderr_buffer)rrr	r	r
�	test_init#szTest_TestResult.test_initcCs"t��}|��|�|jd�dS)NT)rr�stoprr )rrr	r	r
�	test_stop1szTest_TestResult.test_stopcCs�Gdd�dtj�}|d�}t��}|�|�|�|���|�t|j�d�|�t|j	�d�|�|j
d�|�|jd�|�|�dS)Nc@seZdZdd�ZdS)z+Test_TestResult.test_startTest.<locals>.FoocSsdS)Nr	)rr	r	r
�test_1<sz2Test_TestResult.test_startTest.<locals>.Foo.test_1N)rrrr$r	r	r	r
�Foo;sr%r$r�F)
r�TestCaser�	startTestrrrrrrrr �stopTest)rr%�testrr	r	r
�test_startTest:s
zTest_TestResult.test_startTestcCs�Gdd�dtj�}|d�}t��}|�|�|�|���|�t|j�d�|�t|j	�d�|�|j
d�|�|jd�|�|�|�|���|�t|j�d�|�t|j	�d�|�|j
d�|�|jd�dS)Nc@seZdZdd�ZdS)z*Test_TestResult.test_stopTest.<locals>.FoocSsdS)Nr	)rr	r	r
r$Qsz1Test_TestResult.test_stopTest.<locals>.Foo.test_1N)rrrr$r	r	r	r
r%Psr%r$rr&F)
rr'rr(rrrrrrrr r))rr%r*rr	r	r
�
test_stopTestOs

zTest_TestResult.test_stopTestcCst��}|��|��dS)N)rr�startTestRun�stopTestRun)rrr	r	r
�test_startTestRun_stopTestRunjsz-Test_TestResult.test_startTestRun_stopTestRuncCs�Gdd�dtj�}|d�}t��}|�|�|�|�|�|�|�|���|�t	|j
�d�|�t	|j�d�|�|jd�|�|j
d�dS)Nc@seZdZdd�ZdS)z,Test_TestResult.test_addSuccess.<locals>.FoocSsdS)Nr	)rr	r	r
r$�sz3Test_TestResult.test_addSuccess.<locals>.Foo.test_1N)rrrr$r	r	r	r
r%�sr%r$rr&F)rr'rr(�
addSuccessr)rrrrrrrr )rr%r*rr	r	r
�test_addSuccess�s


zTest_TestResult.test_addSuccesscCs�Gdd�dtj�}|d�}y|�d�Wnt��}YnXt��}|�|�|�||�|�|�|�	|�
��|�t|j
�d�|�t|j�d�|�|jd�|�|jd�|jd\}}|�||�|�|t�dS)Nc@seZdZdd�ZdS)z,Test_TestResult.test_addFailure.<locals>.FoocSsdS)Nr	)rr	r	r
r$�sz3Test_TestResult.test_addFailure.<locals>.Foo.test_1N)rrrr$r	r	r	r
r%�sr%r$�foorr&F)rr'�fail�sys�exc_inforr(�
addFailurer)�assertFalserrrrrrr �assertIs�assertIsInstance�str)rr%r*�exc_info_tupler�	test_case�
formatted_excr	r	r
�test_addFailure�s$

zTest_TestResult.test_addFailurecCs�Gdd�dtj�}|d�}y
t��Wnt��}YnXt��}|�|�|�||�|�|�|�	|�
��|�t|j
�d�|�t|j�d�|�|jd�|�|jd�|j
d\}}|�||�|�|t�dS)Nc@seZdZdd�ZdS)z*Test_TestResult.test_addError.<locals>.FoocSsdS)Nr	)rr	r	r
r$�sz1Test_TestResult.test_addError.<locals>.Foo.test_1N)rrrr$r	r	r	r
r%�sr%r$r&rF)rr'�	TypeErrorr4r5rr(�addErrorr)r7rrrrrrr r8r9r:)rr%r*r;rr<r=r	r	r
�
test_addError�s$


zTest_TestResult.test_addErrorcCs�Gdd�dtj�}|d�}t��}d|_ttj_|�t�|�	�|�
|�|��|�t
|j�d�|jd\}}|�d|�dS)Nc@seZdZdd�ZdS)z1Test_TestResult.test_addError_locals.<locals>.FoocSsdddS)Nr&rr	)rr	r	r
r$�sz8Test_TestResult.test_addError_locals.<locals>.Foo.test_1N)rrrr$r	r	r	r
r%�sr%r$Tr&rzA tracebacklocals)rr'r�	tb_localsrrr�
addCleanuprr-�runr.rrr)rr%r*rr<r=r	r	r
�test_addError_locals�s

z$Test_TestResult.test_addError_localscs�G���fdd�dtj�}d�|d��t�������|�����|�t�j�d�|�t�j	�d�|��j
d�|��jd��jd\}}|�|��|�
d|��j	d\}}|�|��|�
d|�dS)	NcseZdZ���fdd�ZdS)z,Test_TestResult.test_addSubTest.<locals>.Fooc	sd|jdd��N|j�yddWntk
r<t��}YnX����|�|�d�WdQRXdS)Nr&)r2rzsome recognizable failure)�subTest�_subtest�ZeroDivisionErrorr4r5Z
addSubTestr3)rr;)r�subtestr*r	r
r$	sz3Test_TestResult.test_addSubTest.<locals>.Foo.test_1N)rrrr$r	)rrIr*r	r
r%sr%r$r&FrrHzsome recognizable failure)rr'rrDr7rrrrrrr r8ZassertIn)rr%r<r=r	)rrIr*r
�test_addSubTests 
zTest_TestResult.test_addSubTestcCs,t�ddd�}|�|�|�dtd�dS)NTr&z$testGetDescriptionWithoutDocstring (z.Test_TestResult))r�TextTestResultr�getDescriptionr)rrr	r	r
�"testGetDescriptionWithoutDocstring)s
z2Test_TestResult.testGetDescriptionWithoutDocstringc	Cs�|jddd��0t�ddd�}|�|�|j�dtd�WdQRX|�d��0t�ddd�}|�|�|j�dtd�WdQRXdS)	Nr&�)r2�barTz+testGetSubTestDescriptionWithoutDocstring (z .Test_TestResult) (foo=1, bar=2)zsome messagez .Test_TestResult) [some message])rFrrKrrLrGr)rrr	r	r
�)testGetSubTestDescriptionWithoutDocstring0s

z9Test_TestResult.testGetSubTestDescriptionWithoutDocstringc	CsB|���0t�ddd�}|�|�|j�dtd�WdQRXdS)NTr&z4testGetSubTestDescriptionWithoutDocstringAndParams (z.Test_TestResult) (<subtest>))rFrrKrrLrGr)rrr	r	r
�2testGetSubTestDescriptionWithoutDocstringAndParams>s


zBTest_TestResult.testGetSubTestDescriptionWithoutDocstringAndParamsc
Cs\d}t�ddd�}xDddggD]6}|�|��"|�|�|j�|t|f�WdQRXqWdS)NzAtestGetSubTestDescriptionForFalsyValues (%s.Test_TestResult) [%s]Tr&r)rrKrFrrLrGr)rZexpectedr�argr	r	r
�'testGetSubTestDescriptionForFalsyValuesFs
z7Test_TestResult.testGetSubTestDescriptionForFalsyValuesc
Cs`|jdd��J|jddd��0t�ddd�}|�|�|j�dtd�WdQRXWdQRXdS)	Nr&)r2rN�)�bazrOTz1testGetNestedSubTestDescriptionWithoutDocstring (z'.Test_TestResult) (baz=2, bar=3, foo=1))rFrrKrrLrGr)rrr	r	r
�/testGetNestedSubTestDescriptionWithoutDocstringPs
z?Test_TestResult.testGetNestedSubTestDescriptionWithoutDocstringc
Csb|jddd��J|jddd��0t�ddd�}|�|�|j�dtd	�WdQRXWdQRXdS)
Nr&rN)r2rOrT�)rUrOTz;testGetDuplicatedNestedSubTestDescriptionWithoutDocstring (z'.Test_TestResult) (baz=3, bar=4, foo=1))rFrrKrrLrGr)rrr	r	r
�9testGetDuplicatedNestedSubTestDescriptionWithoutDocstringYs
zITest_TestResult.testGetDuplicatedNestedSubTestDescriptionWithoutDocstringrNz)Docstrings are omitted with -O2 and abovecCs,t�ddd�}|�|�|�dtd�dS)NTr&z(testGetDescriptionWithOneLineDocstring (zG.Test_TestResult)
Tests getDescription() for a method with a docstring.)rrKrrLr)rrr	r	r
�&testGetDescriptionWithOneLineDocstringbsz6Test_TestResult.testGetDescriptionWithOneLineDocstringc	CsHt�ddd�}|jddd��"|�|�|j�dtd�WdQRXdS)NTr&rN)r2rOz/testGetSubTestDescriptionWithOneLineDocstring (zV.Test_TestResult) (foo=1, bar=2)
Tests getDescription() for a method with a docstring.)rrKrFrrLrGr)rrr	r	r
�-testGetSubTestDescriptionWithOneLineDocstringms

z=Test_TestResult.testGetSubTestDescriptionWithOneLineDocstringcCs,t�ddd�}|�|�|�dtd�dS)NTr&z*testGetDescriptionWithMultiLineDocstring (zN.Test_TestResult)
Tests getDescription() for a method with a longer docstring.)rrKrrLr)rrr	r	r
�(testGetDescriptionWithMultiLineDocstringysz8Test_TestResult.testGetDescriptionWithMultiLineDocstringc	CsHt�ddd�}|jddd��"|�|�|j�dtd�WdQRXdS)NTr&rN)r2rOz1testGetSubTestDescriptionWithMultiLineDocstring (z].Test_TestResult) (foo=1, bar=2)
Tests getDescription() for a method with a longer docstring.)rrKrFrrLrGr)rrr	r	r
�/testGetSubTestDescriptionWithMultiLineDocstring�s

z?Test_TestResult.testGetSubTestDescriptionWithMultiLineDocstringcCsHGdd�dt�}t��}|�|�|��d|jjd<|�|�|��dS)Nc@seZdZGdd�de�ZdS)z5Test_TestResult.testStackFrameTrimming.<locals>.Framec@seZdZiZdS)z>Test_TestResult.testStackFrameTrimming.<locals>.Frame.tb_frameN)rrr�	f_globalsr	r	r	r
�tb_frame�sr^N)rrr�objectr^r	r	r	r
�Frame�sr`TZ
__unittest)r_rrr7Z_is_relevant_tb_levelr^r]r)rr`rr	r	r
�testStackFrameTrimming�s
z&Test_TestResult.testStackFrameTrimmingcCs�t��}dd�|_d|_|�dd�|�|j�t��}dd�|_d|_|�dd�|�|j�t��}dd�|_d|_|�d�|�|j�dS)NcWsdS)N�r	)�_r	r	r
�<lambda>��z.Test_TestResult.testFailFast.<locals>.<lambda>TcWsdS)Nrbr	)rcr	r	r
rd�recWsdS)Nrbr	)rcr	r	r
rd�re)	rrZ_exc_info_to_string�failfastr@rr r6�addUnexpectedSuccess)rrr	r	r
�testFailFast�s



zTest_TestResult.testFailFastcs,tjt��dd�}�fdd�}|�|�}dS)NT)�streamrfcs��|j�dS)N)rrf)r)rr	r
r*�sz5Test_TestResult.testFailFastSetByRunner.<locals>.test)r�TextTestRunner�io�StringIOrD)r�runnerr*rr	)rr
�testFailFastSetByRunner�sz'Test_TestResult.testFailFastSetByRunnerN)rrrr!r#r+r,r/r1r>rArErJrMrPrQrSrVrXrZskipIfr4�flags�optimizerYrZr[r\rarhrnr	r	r	r
rs6
	'0"
		


r)ZaddSkipZaddExpectedFailurergrcCs(g|_g|_d|_d|_d|_d|_dS)NrF)rrrr �bufferrB)rriZdescriptions�	verbosityr	r	r
r�sr�	OldResultc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�Test_OldTestResultc	Cs@t�dtf��(t�}|�|�|�t|j�|�WdQRXdS)NzTestResult has no add.+ method,)rZcheck_warnings�RuntimeWarningrsrDrrr)rr*rrr	r	r
�assertOldResultWarning�s


z)Test_OldTestResult.assertOldResultWarningcCsBGdd�dtj�}x*dD]"\}}||�}|�|t|��qWdS)Nc@s0eZdZdd�Zejdd��Zejdd��ZdS)z2Test_OldTestResult.testOldTestResult.<locals>.TestcSs|�d�dS)NZfoobar)�skipTest)rr	r	r
�testSkip�sz;Test_OldTestResult.testOldTestResult.<locals>.Test.testSkipcSst�dS)N)r?)rr	r	r
�testExpectedFail�szCTest_OldTestResult.testOldTestResult.<locals>.Test.testExpectedFailcSsdS)Nr	)rr	r	r
�testUnexpectedSuccess�szHTest_OldTestResult.testOldTestResult.<locals>.Test.testUnexpectedSuccessN)rrrrxrZexpectedFailureryrzr	r	r	r
�Test�sr{))rxT)ryT)rzF)rr'rv�int)rr{Z	test_nameZshould_passr*r	r	r
�testOldTestResult�s
z$Test_OldTestResult.testOldTestResultcCs&Gdd�dtj�}|�|d�d�dS)Nc@seZdZdd�Zdd�ZdS)z7Test_OldTestResult.testOldTestTesultSetup.<locals>.TestcSs|�d�dS)Nz	no reason)rw)rr	r	r
�setUp�sz=Test_OldTestResult.testOldTestTesultSetup.<locals>.Test.setUpcSsdS)Nr	)rr	r	r
�testFoo�sz?Test_OldTestResult.testOldTestTesultSetup.<locals>.Test.testFooN)rrrr~rr	r	r	r
r{�sr{rr)rr'rv)rr{r	r	r
�testOldTestTesultSetup�sz)Test_OldTestResult.testOldTestTesultSetupcCs0t�d�Gdd�dtj��}|�|d�d�dS)Nz	no reasonc@seZdZdd�ZdS)z7Test_OldTestResult.testOldTestResultClass.<locals>.TestcSsdS)Nr	)rr	r	r
r�sz?Test_OldTestResult.testOldTestResultClass.<locals>.Test.testFooN)rrrrr	r	r	r
r{�sr{rr)r�skipr'rv)rr{r	r	r
�testOldTestResultClass�s
z)Test_OldTestResult.testOldTestResultClasscCs6Gdd�dtj�}tjtt��d�}|�|d��dS)Nc@seZdZdd�ZdS)z8Test_OldTestResult.testOldResultWithRunner.<locals>.TestcSsdS)Nr	)rr	r	r
r�sz@Test_OldTestResult.testOldResultWithRunner.<locals>.Test.testFooN)rrrrr	r	r	r
r{�sr{)Zresultclassrir)rr'rjrsrkrlrD)rr{rmr	r	r
�testOldResultWithRunner�sz*Test_OldTestResult.testOldResultWithRunnerN)rrrrvr}r�r�r�r	r	r	r
rt�s
rtc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�TestOutputBufferingcCstj|_tj|_dS)N)r4�stdout�	_real_out�stderr�	_real_err)rr	r	r
r~szTestOutputBuffering.setUpcCs|jt_|jt_dS)N)r�r4r�r�r�)rr	r	r
�tearDownszTestOutputBuffering.tearDowncCsf|j}|j}t��}|�|j�|�|tj�|�|tj	�|�
|�|�|tj�|�|tj	�dS)N)r�r�rrr7rqr8r4r�r�r()r�real_out�real_errrr	r	r
�testBufferOutputOffs
z'TestOutputBuffering.testBufferOutputOffcCs�|j}|j}t��}|�|j�d|_|�|tj�|�|tj	�|�
|�|�|tj�|�|tj	�|�tjt
j�|�tj	t
j�|�tjtj	�tj}tj	}t
��|_t
��|_td�tdtj	d�|�|��d�|�|��d�|�|j��d�|�|j��d�|�|�|�|�|�tj|j�|�tj	|j�|�|j��d�|�|j��d�|�|��d�|�|��d�dS)NTr2rO)�filezfoo
zbar
rb)r�r�rrr7rqr8r4r�r�r(ZassertIsNotr9rkrl�_original_stdout�_original_stderr�printr�getvaluer0r))rr�r�rZ
out_streamZ
err_streamr	r	r
�#testBufferOutputStartTestAddSuccesss>




z7TestOutputBuffering.testBufferOutputStartTestAddSuccesscCst��}d|_|�|�|S)NT)rrrqr()rrr	r	r
�getStartedResultGs
z$TestOutputBuffering.getStartedResultcCsttj_|�t��xdD]�\}}}|��}tj}tj	}t
��|_t
��|_
tdtjd�|rltdtj	d�t||�}||d�|�|�t||�}|�t|�d�|d\}	}
t�d�}d	}|r�t�d
�}d||f}
|�|	|�|�|j��|�|�|j
��|�|�|
|
�qWdS)N))rr@T)rr6F)rr@T)rr6Fr2)r�rO)NNNr&rz9
                Stdout:
                foo
            rbz9
                Stderr:
                bar
            zA traceback%s%s)rrrrrCrr�r4r�r�rkrlr�r�r��getattrr)rr�textwrap�dedentr8r�ZassertMultiLineEqual)rZmessage_attrZadd_attrZ
include_errorrZbuffered_outZbuffered_errZaddFunctionZresult_listr*�messageZexpectedOutMessageZexpectedErrMessageZexpectedFullMessager	r	r
�!testBufferOutputAddErrorOrFailureMs8






z5TestOutputBuffering.testBufferOutputAddErrorOrFailurecCsNt��}d|_Gdd�dtj�}t�|d�g�}||�|�t|j�d�dS)NTc@s eZdZedd��Zdd�ZdS)z5TestOutputBuffering.testBufferSetupClass.<locals>.FoocSsdddS)Nr&rr	)�clsr	r	r
�
setUpClass�sz@TestOutputBuffering.testBufferSetupClass.<locals>.Foo.setUpClasscSsdS)Nr	)rr	r	r
�test_foo�sz>TestOutputBuffering.testBufferSetupClass.<locals>.Foo.test_fooN)rrr�classmethodr�r�r	r	r	r
r%�sr%r�r&)rrrqr'�	TestSuiterrr)rrr%�suiter	r	r
�testBufferSetupClass|sz(TestOutputBuffering.testBufferSetupClasscCsNt��}d|_Gdd�dtj�}t�|d�g�}||�|�t|j�d�dS)NTc@s eZdZedd��Zdd�ZdS)z8TestOutputBuffering.testBufferTearDownClass.<locals>.FoocSsdddS)Nr&rr	)r�r	r	r
�
tearDownClass�szFTestOutputBuffering.testBufferTearDownClass.<locals>.Foo.tearDownClasscSsdS)Nr	)rr	r	r
r��szATestOutputBuffering.testBufferTearDownClass.<locals>.Foo.test_fooN)rrrr�r�r�r	r	r	r
r%�sr%r�r&)rrrqr'r�rrr)rrr%r�r	r	r
�testBufferTearDownClass�sz+TestOutputBuffering.testBufferTearDownClasscCs~t��}d|_Gdd�dtj�}Gdd�dt�}d|_|tjd<|�tjj	d�t�
|d�g�}||�|�t|j
�d�dS)NTc@seZdZdd�ZdS)z6TestOutputBuffering.testBufferSetUpModule.<locals>.FoocSsdS)Nr	)rr	r	r
r��sz?TestOutputBuffering.testBufferSetUpModule.<locals>.Foo.test_fooN)rrrr�r	r	r	r
r%�sr%c@seZdZedd��ZdS)z9TestOutputBuffering.testBufferSetUpModule.<locals>.ModulecSsdddS)Nr&rr	r	r	r	r
�setUpModule�szETestOutputBuffering.testBufferSetUpModule.<locals>.Module.setUpModuleN)rrr�staticmethodr�r	r	r	r
�Module�sr�r�r&)rrrqr'r_rr4�modulesrC�popr�rrr)rrr%r�r�r	r	r
�testBufferSetUpModule�s
z)TestOutputBuffering.testBufferSetUpModulecCs~t��}d|_Gdd�dtj�}Gdd�dt�}d|_|tjd<|�tjj	d�t�
|d�g�}||�|�t|j
�d�dS)NTc@seZdZdd�ZdS)z9TestOutputBuffering.testBufferTearDownModule.<locals>.FoocSsdS)Nr	)rr	r	r
r��szBTestOutputBuffering.testBufferTearDownModule.<locals>.Foo.test_fooN)rrrr�r	r	r	r
r%�sr%c@seZdZedd��ZdS)z<TestOutputBuffering.testBufferTearDownModule.<locals>.ModulecSsdddS)Nr&rr	r	r	r	r
�tearDownModule�szKTestOutputBuffering.testBufferTearDownModule.<locals>.Module.tearDownModuleN)rrrr�r�r	r	r	r
r��sr�r�r&)rrrqr'r_rr4r�rCr�r�rrr)rrr%r�r�r	r	r
�testBufferTearDownModule�s
z,TestOutputBuffering.testBufferTearDownModuleN)
rrrr~r�r�r�r�r�r�r�r�r�r	r	r	r
r��s0/r��__main__)NNN)rkr4r�r*rrrr_rrr'r�dictr�__dict__Z	classDict�mr�typersrtr�r�mainr	r	r	r
�<module>s,
$


4B