File "suite.cpython-37.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python37/lib64/python3.7/unittest/__pycache__/suite.cpython-37.pyc
File size: 8.98 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

B

 f(@s|dZddlZddlmZddlmZdZddZGd	d
d
eZGdddeZ	Gdd
d
eZ
ddZGdddeZdS)	TestSuiteN)case)utilTcCst||dd}|dS)NcSsdS)Nrrr3/opt/alt/python37/lib64/python3.7/unittest/suite.py<lambda>z!_call_if_exists.<locals>.<lambda>)getattr)parentattrfuncrrr_call_if_existssrc@sneZdZdZdZdddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZdS)
BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures.
    TrcCsg|_d|_||dS)Nr)_tests_removed_testsaddTests)selftestsrrr__init__szBaseTestSuite.__init__cCsdt|jt|fS)Nz
<%s tests=%s>)rstrclass	__class__list)rrrr__repr__szBaseTestSuite.__repr__cCs t||jstSt|t|kS)N)
isinstancerNotImplementedr)rotherrrr__eq__szBaseTestSuite.__eq__cCs
t|jS)N)iterr)rrrr__iter__"szBaseTestSuite.__iter__cCs(|j}x|D]}|r||7}qW|S)N)rcountTestCases)rZcasestestrrrr %s

zBaseTestSuite.countTestCasescCsLt|stdt|t|tr<t|tjt	fr<td|j
|dS)Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest())callable	TypeErrorformatreprrtype
issubclassrZTestCaserrappend)rr!rrraddTest,szBaseTestSuite.addTestcCs.t|trtdx|D]}||qWdS)Nz0tests must be an iterable of tests, not a string)rstrr#r))rrr!rrrr6s

zBaseTestSuite.addTestscCs:x4t|D](\}}|jrP|||jr
||q
W|S)N)	enumerate
shouldStop_cleanup_removeTestAtIndex)rresultindexr!rrrrun<szBaseTestSuite.runcCsNy|j|}Wntk
r"Yn(Xt|dr@|j|7_d|j|<dS)z2Stop holding a reference to the TestCase at index.r N)rr#hasattrrr )rr0r!rrrr.Es
z BaseTestSuite._removeTestAtIndexcOs|j||S)N)r1)rargskwdsrrr__call__SszBaseTestSuite.__call__cCsx|D]}|qWdS)z7Run the tests without collecting errors in a TestResultN)debug)rr!rrrr6Vs
zBaseTestSuite.debugN)r)__name__
__module____qualname____doc__r-rrrrr r)rr1r.r5r6rrrrrs

	rc@sReZdZdZdddZddZddZd	d
ZddZd
dZ	ddZ
ddZdS)raA test suite is a composite test consisting of a number of TestCases.

    For use, create an instance of TestSuite, then add test case instances.
    When all tests have been added, the suite can be passed to a test
    runner, such as TextTestRunner. It will run the individual test cases
    in the order in which they were added, aggregating the results. When
    subclassing, do not forget to call the base class constructor.
    FcCsd}t|dddkrd|_}xt|D]\}}|jr8Pt|r||||||||||j|_	t|jdds(t|ddrq(|s||n|
|jr(||q(W|r|d||
|d|_|S)NF_testRunEnteredT_classSetupFailed_moduleSetUpFailed)r
r;r+r,_isnotsuite_tearDownPreviousClass_handleModuleFixture_handleClassSetUpr_previousTestClassr6r-r._handleModuleTearDown)rr/r6ZtopLevelr0r!rrrr1fs0


z
TestSuite.runcCst}||ddS)z7Run the tests without collecting errors in a TestResultTN)_DebugResultr1)rr6rrrr6szTestSuite.debugc	
Cst|dd}|j}||krdS|jr(dSt|ddr8dSy
d|_Wntk
rVYnXt|dd}|dk	rt|dzdy
|WnTtk
r}z6t|trd|_t	
|}d|}||||Wdd}~XYnXWdt|dXdS)	NrB__unittest_skip__F
setUpClass_setupStdoutTzsetUpClass (%s)_restoreStdout)r
rr=r<r#r	ExceptionrrDrr_addClassOrModuleLevelException)	rr!r/
previousClasscurrentClassrFe	className	errorNamerrrrAs2




$zTestSuite._handleClassSetUpcCs"d}t|dd}|dk	r|j}|S)NrB)r
r8)rr/previousModulerKrrr_get_previous_modules
zTestSuite._get_previous_modulec	
Cs||}|jj}||krdS||d|_ytj|}Wntk
rPdSXt|dd}|dk	rt	|dzZy
|WnJt
k
r}z,t|trd|_d|}|
|||Wdd}~XYnXWdt	|dXdS)NFsetUpModulerGTzsetUpModule (%s)rH)rQrr8rCr=sysmodulesKeyErrorr
rrIrrDrJ)	rr!r/rPZ
currentModulemodulerRrMrOrrrr@s,




$zTestSuite._handleModuleFixturecCsLt|}t|dd}|dk	r8t|tjr8||t|n||tdS)NaddSkip)	_ErrorHolderr
rrZSkipTestr*ZaddErrorrSexc_info)rr/Z	exceptionrOerrorrWrrrrJs
z)TestSuite._addClassOrModuleLevelExceptionc
Cs||}|dkrdS|jr dSytj|}Wntk
rBdSXt|dd}|dk	rt|dzTy
|WnDtk
r}z&t|t	rd|}|
|||Wdd}~XYnXWdt|dXdS)NtearDownModulerGztearDownModule (%s)rH)rQr=rSrTrUr
rrIrrDrJ)rr/rPrVr[rMrOrrrrCs(



$zTestSuite._handleModuleTearDownc	
Cst|dd}|j}||krdSt|ddr.dSt|ddr>dSt|ddrNdSt|dd}|dk	rt|dz^y
|WnNtk
r}z0t|trt|}d|}||||Wdd}~XYnXWdt|d	XdS)
NrBr<Fr=rE
tearDownClassrGztearDownClass (%s)rH)	r
rrrIrrDrrrJ)	rr!r/rKrLr\rMrNrOrrrr?s,



$z TestSuite._tearDownPreviousClassN)F)r7r8r9r:r1r6rArQr@rJrCr?rrrrr\s
! c@sTeZdZdZdZddZddZddZd	d
ZddZ	d
dZ
ddZddZdS)rXz
    Placeholder for a TestCase inside a result. As far as a TestResult
    is concerned, this looks exactly like a unit test. Used to insert
    arbitrary errors into a test suite run.
    NcCs
||_dS)N)description)rr]rrrrsz_ErrorHolder.__init__cCs|jS)N)r])rrrridsz_ErrorHolder.idcCsdS)Nr)rrrrshortDescription sz_ErrorHolder.shortDescriptioncCsd|jfS)Nz<ErrorHolder description=%r>)r])rrrrr#sz_ErrorHolder.__repr__cCs|S)N)r^)rrrr__str__&sz_ErrorHolder.__str__cCsdS)Nr)rr/rrrr1)sz_ErrorHolder.runcCs
||S)N)r1)rr/rrrr5.sz_ErrorHolder.__call__cCsdS)Nrr)rrrrr 1sz_ErrorHolder.countTestCases)
r7r8r9r:ZfailureExceptionrr^r_rr`r1r5r rrrrrXsrXcCs&yt|Wntk
r dSXdS)z?A crude way to tell apart testcases and suites with duck-typingTF)rr#)r!rrrr>4s
r>c@seZdZdZdZdZdZdS)rDzCUsed by the TestSuite to hold previous class when running in debug.NF)r7r8r9r:rBr=r,rrrrrD=srD)
r:rSrrZ
__unittestrobjectrrrXr>rDrrrr<module>sL3&