File "suite.cpython-35.pyc"

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



Yf(@sdZddlZddlmZddlmZdZddZGd	d
d
eZGdddeZ	Gdd
d
eZ
ddZGdddeZdS)	TestSuiteN)case)utilTcCs#t||dd}|dS)NcSsdS)Nrrr3/opt/alt/python35/lib64/python3.5/unittest/suite.py<lambda>sz!_call_if_exists.<locals>.<lambda>)getattr)parentattrfuncrrr_call_if_existssr
c@seZdZdZdZfddZddZddZd	d
ZddZ	d
dZ
ddZddZddZ
ddZddZdS)
BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures.
    TcCs#g|_d|_|j|dS)Nr)_tests_removed_testsaddTests)selftestsrrr__init__s		zBaseTestSuite.__init__cCs dtj|jt|fS)Nz
<%s tests=%s>)rstrclass	__class__list)rrrr__repr__szBaseTestSuite.__repr__cCs,t||jstSt|t|kS)N)
isinstancerNotImplementedr)rotherrrr__eq__szBaseTestSuite.__eq__cCs
t|jS)N)iterr)rrrr__iter__"szBaseTestSuite.__iter__cCs4|j}x$|D]}|r||j7}qW|S)N)rcountTestCases)rZcasestestrrrr%s
	
zBaseTestSuite.countTestCasescCsnt|s'tdjt|t|trZt|tjt	frZtd|j
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]}|j|q"WdS)Nz0tests must be an iterable of tests, not a string)rstrr"r()rrr rrrr6s
zBaseTestSuite.addTestscCsKxDt|D]6\}}|jr#P|||jr
|j|q
W|S)N)	enumerate
shouldStop_cleanup_removeTestAtIndex)rresultindexr rrrrun<s	
	zBaseTestSuite.runcCs[y|j|}Wntk
r%Yn2Xt|drJ|j|j7_d|j|<dS)z2Stop holding a reference to the TestCase at index.rN)rr"hasattrrr)rr/r rrrr-Es
z BaseTestSuite._removeTestAtIndexcOs|j||S)N)r0)rargskwdsrrr__call__SszBaseTestSuite.__call__cCsx|D]}|jqWdS)z7Run the tests without collecting errors in a TestResultN)debug)rr rrrr5Vs
zBaseTestSuite.debugN)__name__
__module____qualname____doc__r,rrrrrr(rr0r-r4r5rrrrrs
	rc@syeZdZdZdddZddZddZd	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.
    FcCs'd}t|dddkr+d|_}xt|D]\}}|jrNPt|r|j|||j|||j|||j|_	t|jdds8t|ddrq8|s||n
|j
|jr8|j|q8W|r#|jd||j
|d|_|S)NF_testRunEnteredT_classSetupFailed_moduleSetUpFailed)r	r:r*r+_isnotsuite_tearDownPreviousClass_handleModuleFixture_handleClassSetUpr_previousTestClassr5r,r-_handleModuleTearDown)rr.r5ZtopLevelr/r rrrr0fs0
	

	
	z
TestSuite.runcCst}|j|ddS)z7Run the tests without collecting errors in a TestResultTN)_DebugResultr0)rr5rrrr5s	zTestSuite.debugc	 Cs.t|dd}|j}||kr+dS|jr8dSt|ddrNdSy
d|_Wntk
roYnXt|dd}|dk	r*t|dz~y|Wnltk
r}zLt|trd|_t	j
|}d|}|j|||WYdd}~XnXWdt|dXdS)	NrA__unittest_skip__F
setUpClass_setupStdoutTzsetUpClass (%s)_restoreStdout)r	rr<r;r"r
	ExceptionrrCrr_addClassOrModuleLevelException)	rr r.
previousClasscurrentClassrEe	className	errorNamerrrr@s2		


	
*zTestSuite._handleClassSetUpcCs1d}t|dd}|dk	r-|j}|S)NrA)r	r7)rr.previousModulerJrrr_get_previous_modules
	zTestSuite._get_previous_modulec	 Cs|j|}|jj}||kr+dS|j|d|_ytj|}Wntk
rjdSYnXt|dd}|dk	rt	|dzoy|Wn]t
k
r}z=t|trd|_d|}|j
|||WYdd}~XnXWdt	|dXdS)NFsetUpModulerFTzsetUpModule (%s)rG)rPrr7rBr<sysmodulesKeyErrorr	r
rHrrCrI)	rr r.rOZ
currentModulemodulerQrLrNrrrr?s,
	
	
	
*zTestSuite._handleModuleFixturecCslt|}t|dd}|dk	rRt|tjrR||t|n|j|tjdS)NaddSkip)	_ErrorHolderr	rrZSkipTestr)ZaddErrorrRexc_info)rr.Z	exceptionrNerrorrVrrrrIs
z)TestSuite._addClassOrModuleLevelExceptionc Cs|j|}|dkrdS|jr,dSytj|}Wntk
rUdSYnXt|dd}|dk	rt|dzfy|WnTtk
r}z4t|t	rd|}|j
|||WYdd}~XnXWdt|dXdS)NtearDownModulerFztearDownModule (%s)rG)rPr<rRrSrTr	r
rHrrCrI)rr.rOrUrZrLrNrrrrBs(	
	

*zTestSuite._handleModuleTearDownc	Cs"t|dd}|j}||kr+dSt|ddrAdSt|ddrWdSt|ddrmdSt|dd}|dk	rt|dzuy|Wnctk
r}zCt|trtj|}d|}|j|||WYdd}~XnXWdt|d	XdS)
NrAr;Fr<rD
tearDownClassrFztearDownClass (%s)rG)	r	rr
rHrrCrrrI)	rr r.rJrKr[rLrMrNrrrr>s,	

*z TestSuite._tearDownPreviousClassN)r6r7r8r9r0r5r@rPr?rIrBr>rrrrr\s! c@s|eZdZdZdZddZddZddZd	d
ZddZ	d
dZ
ddZddZdS)rWz
    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.shortDescriptioncCsd|jfS)Nz<ErrorHolder description=%r>)r\)rrrrr#sz_ErrorHolder.__repr__cCs
|jS)N)r])rrrr__str__&sz_ErrorHolder.__str__cCsdS)Nr)rr.rrrr0)sz_ErrorHolder.runcCs
|j|S)N)r0)rr.rrrr4.sz_ErrorHolder.__call__cCsdS)Nrr)rrrrr1sz_ErrorHolder.countTestCases)
r6r7r8r9ZfailureExceptionrr]r^rr_r0r4rrrrrrWsrWcCs+yt|Wntk
r&dSYnXdS)z?A crude way to tell apart testcases and suites with duck-typingTF)rr")r rrrr=4s

	r=c@s(eZdZdZdZdZdZdS)rCzCUsed by the TestSuite to hold previous class when running in debug.NF)r6r7r8r9rAr<r+rrrrrC=srC)
r9rRrrZ
__unittestr
objectrrrWr=rCrrrr<module>sL&