ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python37/lib64/python3.7/unittest/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python37/lib64/python3.7/unittest/__pycache__/main.cpython-37.opt-2.pyc

B

0��c�+�@spddlZddlZddlZddlmZmZddlmZdZdZ	dZ
dd	�Zd
d�Zdd
�Z
Gdd�de�ZeZdS)�N�)�loader�runner)�installHandlerTaExamples:
  %(prog)s test_module               - run tests from test_module
  %(prog)s module.TestClass          - run tests from module.TestClass
  %(prog)s module.Class.test_method  - run specified test method
  %(prog)s path/to/test_file.py      - run tests from test_file.py
aFExamples:
  %(prog)s                           - run default set of tests
  %(prog)s MyTestSuite               - run suite 'MyTestSuite'
  %(prog)s MyTestCase.testSomething  - run MyTestCase.testSomething
  %(prog)s MyTestCase                - run all 'test*' test methods
                                       in MyTestCase
cCsxtj�|�rt|���d�rttj�|�rXtj�|t���}tj�|�sP|�tj	�rT|S|}|dd��
dd��
dd�S|S)Nz.py����\�.�/)�os�path�isfile�lower�endswith�isabs�relpath�getcwd�
startswith�pardir�replace)�nameZrel_path�r�2/opt/alt/python37/lib64/python3.7/unittest/main.py�
_convert_namesrcCsdd�|D�S)NcSsg|]}t|��qSr)r)�.0rrrr�
<listcomp>.sz"_convert_names.<locals>.<listcomp>r)�namesrrr�_convert_names-srcCsd|krd|}|S)N�*z*%s*r)�patternrrr�_convert_select_pattern1src@s�eZdZdZdZdZZZZZ	Z
dZddddej
ddddddfdd�dd�Zdd	d
�Zdd�Zd
d�Zddd�Zdd�Zdd�Zdd�Zdd�Zddd�Zdd�ZdS) �TestProgramNr�__main__TF)�	tb_localscCs�t|t�r@t|�|_x0|�d�dd�D]}
t|j|
�|_q(Wn||_|dkrTtj}||_||_	|	|_
||_|
|_||_
|dkr�tjs�d|_n||_||_||_||_tj�|d�|_|�|�|��dS)Nrr�defaultr)�
isinstance�str�
__import__�module�split�getattr�sys�argv�exit�failfast�
catchbreak�	verbosity�bufferr"�warnoptions�warnings�defaultTest�
testRunner�
testLoaderr
r�basename�progName�	parseArgs�runTests)�selfr'r3r+r4r5r,r/r-r.r0r2r"�partrrr�__init__As,


zTestProgram.__init__cCs4|rt|�|jdkr|��|��t�d�dS)N�)�print�_discovery_parser�_initArgParsers�_print_helpr*r,)r:�msgrrr�	usageExitgs
zTestProgram.usageExitcOsZ|jdkr6t|j���ttd|ji�|j��n t|j���ttd|ji�dS)N�prog)	r'r>�_main_parser�format_help�
MAIN_EXAMPLESr7r?�
print_help�MODULE_EXAMPLES)r:�args�kwargsrrrrAos
zTestProgram._print_helpcCs�|��|jdkrpt|�dkrD|d��dkrD|�|dd��dS|j�|dd�|�|js�|�g�dSn|j�|dd�|�|jr�t|j�|_	t
dkr�d|_n6|jdkr�d|_	n$t|jt
�r�|jf|_	nt|j�|_	|��dS)Nr�discoverr=r!)r@r'�lenr
�
_do_discoveryrE�
parse_args�testsr�	testNames�__name__r3r$r%�list�createTests)r:r+rrrr8xs(


zTestProgram.parseArgscCst|jr|j|j_|r@|dkr"|jn|�}|�|j|j|j�|_n0|jdkr\|j�|j	�|_n|j�
|j|j	�|_dS)N)�testNamePatternsr5rL�startr�top�testrQZloadTestsFromModuler'ZloadTestsFromNames)r:�from_discovery�LoaderrrrrrT�s


zTestProgram.createTestscCs$|��}|�|�|_|�|�|_dS)N)�_getParentArgParser�_getMainArgParserrE�_getDiscoveryArgParserr?)r:Z
parent_parserrrrr@�szTestProgram._initArgParserscCs�tjdd�}|jddddddd	�|jd
ddddd
d	�|jddddd�|jdkrn|jdddddd�d|_|jdkr�|jdddddd�d|_|jdkr�|jdddddd�d|_|jdkr�|jdd d!td"d#�g|_|S)$NF)�add_helpz-vz	--verboser/�store_constr=zVerbose output)�dest�action�const�helpz-qz--quietrzQuiet outputz--localsr"�
store_truez"Show local variables in tracebacks)r`rarcz-fz
--failfastr-zStop on first fail or errorz-cz--catchr.z'Catch Ctrl-C and display results so farz-bz--bufferr0z%Buffer stdout and stderr during testsz-krU�appendz.Only run tests which match the given substring)r`ra�typerc)�argparse�ArgumentParser�add_argumentr-r.r0rUr)r:�parserrrrr[�s>








zTestProgram._getParentArgParsercCs2tj|gd�}|j|_|j|_|jdddd�|S)N)�parentsrPrz?a list of any number of test modules, classes and test methods.)�nargsrc)rgrhr7rDrArHri)r:�parentrjrrrr\�szTestProgram._getMainArgParsercCs~tj|gd�}d|j|_d|_|jddddd�|jd	d
ddd�|jd
dddd�x"dD]}|j|dtjtjd�q\W|S)N)rkz%s discoverzcFor test discovery all test modules must be importable from the top level directory of the project.z-sz--start-directoryrVz*Directory to start discovery ('.' default))r`rcz-pz	--patternrz+Pattern to match tests ('test*.py' default)z-tz--top-level-directoryrWz<Top level directory of project (defaults to start directory))rVrrW�?)rlr#rc)rgrhr7rD�epilogri�SUPPRESS)r:rmrj�argrrrr]�s



z"TestProgram._getDiscoveryArgParsercCsLd|_d|_d|_|dk	r:|jdkr,|��|j�||�|jd|d�dS)Nrztest*.pyT)rYrZ)rVrrWr?r@rOrT)r:r+rZrrrrN�s
zTestProgram._do_discoveryc	Cs�|jrt�|jdkrtj|_t|jt�r�yVy"|j|j|j|j	|j
|jd�}Wn.tk
r||j|j|j|j	|j
d�}YnXWq�tk
r�|��}Yq�Xn|j}|�
|j�|_|jr�t�|j���dS)N)r/r-r0r2r")r/r-r0r2)r.rr4rZTextTestRunnerr$rfr/r-r0r2r"�	TypeError�runrX�resultr,r*Z
wasSuccessful)r:r4rrrr9�s.
zTestProgram.runTests)N)FN)N)rR�
__module__�__qualname__r'r/r-r.r0r7r2rUr?rZdefaultTestLoaderr<rCrAr8rTr@r[r\r]rNr9rrrrr 7s$#
	
#

r )r*rgr
�rrZsignalsrZ
__unittestrGrIrrr�objectr �mainrrrr�<module>s	]

Zerion Mini Shell 1.0