mς LγΈEc@s5dZdkZdkZdeifd„ƒYZdS(s*A Thread base class for use with unittest.Nt TestThreadcBs,tZdZd„Zd„Zdd„ZRS(sZBase class for defining threads that run from unittest. The subclass should define a testrun() method instead of a run() method. Call cleanup() when the test is done with the thread, instead of join(). If the thread exits with an uncaught exception, it's captured and re-raised when cleanup() is called. cleanup() should be called by the main thread! Trying to tell unittest that a test failed from another thread creates a nightmare of timing-depending cascading failures and missed errors (tracebacks that show up on the screen, but don't cause unittest to believe the test failed). cleanup() also joins the thread. If the thread ended without raising an uncaught exception, and the join doesn't succeed in the timeout period, then the test is made to fail with a "Thread still alive" message. cCs*tii|ƒ|idƒd|_dS(Ni(t threadingtThreadt__init__tselft setDaemontNonet _exc_info(R((t3/data/zmath/zope/lib/python/ZEO/tests/TestThread.pyR's cCs+y|iƒWntiƒ|_nXdS(N(Rttestruntsystexc_infoR(R((Rtrun-sicCse|i|ƒ|io%|id|id|id‚n|iƒo|iid|ƒndS(NiiisThread did not finish: %s(RtjointtimeoutRtisAlivet _testcasetfail(RR((Rtcleanup3s   % (t__name__t __module__t__doc__RR R(((RRs   (RRR RR(R RR((Rt?s