Files
PowerToys/PythonHome/Lib/unittest/main.pyc

84 lines
7.7 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc@s<>dZddlZddlZddlZddlmZmZddlmZe Z
dZ dZ dZ d Zd
Zd efd <00><00>YZeZdS( sUnittest main programi<6D><69><EFBFBD><EFBFBD>Ni(tloadertrunner(tinstallHandlers) -f, --failfast Stop on first failure
s7 -c, --catch Catch control-C and display results
s= -b, --buffer Buffer stdout and stderr during test runs
s<EFBFBD>Usage: %(progName)s [options] [tests]
Options:
-h, --help Show this message
-v, --verbose Verbose output
-q, --quiet Minimal output
%(failfast)s%(catchbreak)s%(buffer)s
Examples:
%(progName)s test_module - run tests from test_module
%(progName)s module.TestClass - run tests from module.TestClass
%(progName)s module.Class.test_method - run specified test method
[tests] can be a list of any number of test modules, classes and test
methods.
Alternative Usage: %(progName)s discover [options]
Options:
-v, --verbose Verbose output
%(failfast)s%(catchbreak)s%(buffer)s -s directory Directory to start discovery ('.' default)
-p pattern Pattern to match test files ('test*.py' default)
-t directory Top level directory of project (default to
start directory)
For test discovery all test modules must be importable from the top
level directory of the project.
s1Usage: %(progName)s [options] [test] [...]
Options:
-h, --help Show this message
-v, --verbose Verbose output
-q, --quiet Minimal output
%(failfast)s%(catchbreak)s%(buffer)s
Examples:
%(progName)s - run default set of tests
%(progName)s MyTestSuite - run suite 'MyTestSuite'
%(progName)s MyTestCase.testSomething - run MyTestCase.testSomething
%(progName)s MyTestCase - run all 'test*' test methods
in MyTestCase
t TestProgramc Bs<>eZdZeZd ZZZZ dd d d e
j e dd d d d<00>
Z d d<00>Zd<00>Zd<00>Zd d<00>Zd<00>ZRS(
sA command-line program that runs a set of tests; this is primarily
for making test modules conveniently executable.
t__main__ic Cs<>t|t<00>rTt|<00>|_x<|jd<00>dD]} t|j| <00>|_q2Wn ||_|dkrutj}n||_ ||_
| |_ ||_ |
|_ ||_||_||_tjj|d<19>|_|j|<00>|j<00>dS(Nt.ii(t
isinstancet
basestringt
__import__tmoduletsplittgetattrtNonetsystargvtexittfailfastt
catchbreakt verbositytbuffert defaultTestt
testRunnert
testLoadertostpathtbasenametprogNamet parseArgstrunTests( tselfR RRRRRRRRRtpart((s.\Lib\unittest\main.pyt__init__Hs$            cCs<>|r|GHni|jd6dd6dd6dd6}|jtkrOt|d<n|jtkrkt|d<n|jtkr<>t|d<n|j|GHt j
d<00>dS(NRtRRRi( RRtFalsetFAILFASTRt
CATCHBREAKRt BUFFEROUTPUTtUSAGER R(Rtmsgtusage((s.\Lib\unittest\main.pyt usageExitas
    c Cst|<00>dkr=|dj<00>dkr=|j|d<1F>dSddl}ddddd d
g}y}|j|dd |<00>\}}x<>|D]<5D>\}}|dkr<>|j<00>n|dkr<>d|_n|dkr<>d|_n|dkr |jdkr t|_q n|dkr3|j dkr3t|_ q3n|d kr<>|j
dkr]t|_
q]q<>q<>Wt|<00>dkr<>|j dkr<>d|_ nEt|<00>dkr<>||_ t dkr<>d|_q<>n|j f|_ |j<00>Wn#|jk
r}|j|<00>nXdS(!Nitdiscoverii<><69><EFBFBD><EFBFBD>thelptverbosetquietRtcatchRthHvqfcbs-hs-Hs--helps-qs--quietis-vs --verboses-fs
--failfasts-cs--catchs-bs--bufferR(s-hs-Hs--help(s-qs--quiet(s-vs --verbose(s-fs
--failfast(s-cs--catch(s-bs--buffer(tlentlowert _do_discoverytgetoptR(RRR tTrueRRRt testNamest__name__R t createTeststerror( RRR2t long_optstoptionstargstopttvalueR&((s.\Lib\unittest\main.pyRosB(          !   cCsL|jdkr*|jj|j<00>|_n|jj|j|j<00>|_dS(N(R4R RtloadTestsFromModuleR ttesttloadTestsFromNames(R((s.\Lib\unittest\main.pyR6<00>sc s<>|dkr<00>fd<00>}nd<00>j<16>_ddl}|j<00>}<00>j|_|jdddddtd d
d d <00><01>jtkr<>|jd ddddtd dd d <00>n<00>jtkr<>|jdddddtd dd d <00>n<00>j tkr(|jdddddtd dd d <00>n|jddddddd d<00>|jdddd dd!d d"<00>|jd#d$dd%ddd d&<00>|j
|<00>\}}t |<00>d'kr<><01>j <00>nx-t d)|<00>D]\}}t|||<00>q<>W<>jdkr|j<00>_n<00>jdkr.|j<00>_n<00>j dkrL|j <00>_ n|jrad(<00>_n|j} |j}
|j} |<00>} | j| |
| <00><00>_dS(*Ncs<00>jS(N(R((R(s.\Lib\unittest\main.pyt<lambda><3E>ss %s discoveri<72><69><EFBFBD><EFBFBD>s-vs --verbosetdestR+tdefaultR*sVerbose outputtactiont
store_trues-fs
--failfastRsStop on first fail or errors-cs--catchRs'Catch ctrl-C and display results so fars-bs--bufferRs%Buffer stdout and stderr during testss-ss--start-directorytstartRs*Directory to start discovery ('.' default)s-ps --patterntpatternstest*.pys+Pattern to match tests ('test*.py' default)s-ts--top-level-directoryttops<Top level directory of project (defaults to start directory)ii(sstartspatternstop(R Rtoptparset OptionParsertprogt
add_optionR!RRRt
parse_argsR/R(tziptsetattrR+RRERFRGR)R>( RRtLoaderRHtparserR9R:tnameR<t start_dirRFt top_level_dirR((Rs.\Lib\unittest\main.pyR1<00>sX     


       cCs<>|jrt<00>n|jdkr1tj|_nt|jttj f<00>r<>y+|jd|j
d|j d|j <00>}Wq<57>t k
r<>|j<00>}q<>Xn |j}|j|j<00>|_|jr<>tj|jj<00> <0C>ndS(NRRR(RRRR RtTextTestRunnerRttypettypest ClassTypeRRRt TypeErrortrunR>tresultRR t wasSuccessful(RR((s.\Lib\unittest\main.pyR<00>s 
    N(R5t
__module__t__doc__tUSAGE_FROM_MODULER%R RRRRRtdefaultTestLoaderR3RR(RR6R1R(((s.\Lib\unittest\main.pyR?s      *  8(R]R RRVR RRtsignalsRR3t
__unittestR"R#R$t USAGE_AS_MAINR^tobjectRtmain(((s.\Lib\unittest\main.pyt<module>s   <16>