File "main.cpython-39.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python39/lib64/python3.9/unittest/__pycache__/main.cpython-39.pyc
File size: 7.37 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

a

XC?h+@stdZddlZddlZddlZddlmZmZddlmZdZ	dZ
dZd	d
ZddZ
d
dZGdddeZeZdS)zUnittest main programN)loaderrunner)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
cCstj|r||dr|tj|rXtj|t}tj|sP|tj	rT|S|}tj
|ddddddS|S)Nz.py\./)ospathisfilelowerendswithisabsrelpathgetcwd
startswithpardirnormpathreplace)nameZrel_pathr2/opt/alt/python39/lib64/python3.9/unittest/main.py
_convert_names$rcCsdd|DS)NcSsg|]}t|qSr)r).0rrrr
<listcomp>.z"_convert_names.<locals>.<listcomp>r)namesrrr_convert_names-srcCsd|vrd|}|S)N*z*%s*r)patternrrr_convert_select_pattern1sr!c@seZdZdZdZdZdZZZZ	Z
ZdZdddde
jddddddfdddd	Zdd
dZdd
ZddZdddZddZddZddZddZd ddZddZdS)!TestProgramzA command-line program that runs a set of tests; this is primarily
       for making test modules conveniently executable.
    Nr__main__TF)	tb_localscCst|tr<t||_|dddD]}
t|j|
|_q&n||_|durPtj}||_||_	|	|_
||_|
|_||_
|durtjsd|_n||_||_||_||_tj|d|_|||dS)Nrrdefaultr)
isinstancestr
__import__modulesplitgetattrsysargvexitfailfast
catchbreak	verbositybufferr$warnoptionswarningsdefaultTest
testRunner
testLoaderr
rbasenameprogName	parseArgsrunTests)selfr)r5r-r6r7r.r1r/r0r2r4r$partrrr__init__As,


zTestProgram.__init__cCs4|rt||jdur||tddS)N)print_discovery_parser_initArgParsers_print_helpr,r.)r<msgrrr	usageExitgs
zTestProgram.usageExitcOsZ|jdur6t|jttd|ji|jn t|jttd|jidS)Nprog)	r)r@_main_parserZformat_help
MAIN_EXAMPLESr9rA
print_helpMODULE_EXAMPLES)r<argskwargsrrrrCos
zTestProgram._print_helpcCs||jdurpt|dkrD|ddkrD||dddS|j|dd||js|gdSn|j|dd||jrt|j|_	t
dkrd|_n6|jdurd|_	n$t|jt
r|jf|_	nt|j|_	|dS)Nrdiscoverr?r#)rBr)lenr

_do_discoveryrG
parse_argstestsr	testNames__name__r5r&r'listcreateTests)r<r-rrrr:xs(


zTestProgram.parseArgscCst|jr|j|j_|r@|dur"|jn|}||j|j|j|_n0|jdur\|j|j	|_n|j
|j|j	|_dSN)testNamePatternsr7rMstartr toptestrRZloadTestsFromModuler)ZloadTestsFromNames)r<from_discoveryLoaderrrrrrUs


zTestProgram.createTestscCs$|}|||_|||_dSrV)_getParentArgParser_getMainArgParserrG_getDiscoveryArgParserrA)r<Z
parent_parserrrrrBszTestProgram._initArgParserscCstjdd}|jddddddd	|jd
ddddd
d	|jddddd|jdurn|jddddddd|_|jdur|jddddddd|_|jdur|jddddddd|_|jdur|jdd d!td"d#g|_|S)$NF)Zadd_helpz-vz	--verboser1Zstore_constr?zVerbose output)destactionZconsthelpz-qz--quietrzQuiet outputz--localsr$
store_truez"Show local variables in tracebacks)r`rarbz-fz
--failfastr/zStop on first fail or errorz-cz--catchr0z'Catch Ctrl-C and display results so farz-bz--bufferr2z%Buffer stdout and stderr during testsz-krWappendz.Only run tests which match the given substring)r`ratyperb)argparseArgumentParseradd_argumentr/r0r2rWr!)r<parserrrrr]sL








zTestProgram._getParentArgParsercCs2tj|gd}|j|_|j|_|jdddd|S)NparentsrQrz?a list of any number of test modules, classes and test methods.)nargsrb)rfrgr9rFrCrIrh)r<parentrirrrr^szTestProgram._getMainArgParsercCsztj|gd}d|j|_d|_|jddddd|jd	d
ddd|jd
dddddD]}|j|dtjtjdqZ|S)Nrjz%s discoverzcFor test discovery all test modules must be importable from the top level directory of the project.z-sz--start-directoryrXz*Directory to start discovery ('.' default))r`rbz-pz	--patternr z+Pattern to match tests ('test*.py' default)z-tz--top-level-directoryrYz<Top level directory of project (defaults to start directory))rXr rY?)rlr%rb)rfrgr9rFZepilogrhZSUPPRESS)r<rmriargrrrr_s$


z"TestProgram._getDiscoveryArgParsercCsLd|_d|_d|_|dur:|jdur,||j|||jd|ddS)Nrztest*.pyT)r[r\)rXr rYrArBrPrU)r<r-r\rrrrOs
zTestProgram._do_discoveryc	Cs|jrt|jdurtj|_t|jtrzTz"|j|j|j|j	|j
|jd}Wn,tyz|j|j|j|j	|j
d}Yn0Wqty|}Yq0n|j}|
|j|_|jrt|jdS)N)r1r/r2r4r$)r1r/r2r4)r0rr6rZTextTestRunnerr&rer1r/r2r4r$	TypeErrorrunrZresultr.r,Z
wasSuccessful)r<r6rrrr;s2

zTestProgram.runTests)N)FN)N)rS
__module____qualname____doc__r)r1r/r0r2r9r4rWrArZdefaultTestLoaderr>rErCr:rUrBr]r^r_rOr;rrrrr"7s,&
	
#

r")rur,rfr
rrZsignalsrZ
__unittestrHrJrrr!objectr"mainrrrr<module>s	]