/opt/alt/python27/lib/python2.7/site-packages/nose
NameSizeModeActions
ext/-0755rm
plugins/-0755rm
sphinx/-0755rm
tools/-0755rm
case.py131710644editdlrm
case.pyc150950644editdlrm
case.pyo150950644editdlrm
commands.py63100644editdlrm
commands.pyc61500644editdlrm
commands.pyo61500644editdlrm
config.py252360644editdlrm
config.pyc242570644editdlrm
config.pyo242570644editdlrm
core.py130930644editdlrm
core.pyc134690644editdlrm
core.pyo134690644editdlrm
exc.py3760644editdlrm
exc.pyc5890644editdlrm
exc.pyo5890644editdlrm
failure.py12490644editdlrm
failure.pyc20000644editdlrm
failure.pyo20000644editdlrm
importer.py59780644editdlrm
importer.pyc57620644editdlrm
importer.pyo57620644editdlrm
inspector.py69860644editdlrm
inspector.pyc60920644editdlrm
inspector.pyo60920644editdlrm
loader.py254910644editdlrm
loader.pyc189420644editdlrm
loader.pyo188950644editdlrm
proxy.py68790644editdlrm
proxy.pyc83950644editdlrm
proxy.pyo81910644editdlrm
pyversion.py74240644editdlrm
pyversion.pyc95370644editdlrm
pyversion.pyo95370644editdlrm
result.py67110644editdlrm
result.pyc70750644editdlrm
result.pyo70750644editdlrm
selector.py90900644editdlrm
selector.pyc92670644editdlrm
selector.pyo92670644editdlrm
suite.py223410644editdlrm
suite.pyc224620644editdlrm
suite.pyo224620644editdlrm
twistedtools.py55250644editdlrm
twistedtools.pyc63190644editdlrm
twistedtools.pyo63190644editdlrm
usage.txt44250644editdlrm
util.py201370644editdlrm
util.pyc216160644editdlrm
util.pyo216160644editdlrm
__init__.py4040644editdlrm
__init__.pyc7020644editdlrm
__init__.pyo7020644editdlrm
__main__.py1440644editdlrm
__main__.pyc3620644editdlrm
__main__.pyo3620644editdlrm
Edit: /opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pyo (6319B)
Ñò [O_Qc@sŠdZddkZddklZlZddklZlZddddd gZda d „Z e ƒ\Z Z d „Z dd „ZdS( sv Twisted integration ------------------- This module provides a very simple way to integrate your tests with the Twisted_ event loop. You must import this module *before* importing anything from Twisted itself! Example:: from nose.twistedtools import reactor, deferred @deferred() def test_resolve(): return reactor.resolve("www.python.org") Or, more realistically:: @deferred(timeout=5.0) def test_resolve(): d = reactor.resolve("www.python.org") def check_ip(ip): assert ip == "67.15.36.43" d.addCallback(check_ip) return d .. _Twisted: http://twistedmatrix.com/trac/ iÿÿÿÿN(tQueuetEmpty(tmake_decoratort TimeExpiredtthreaded_reactortreactortdeferredRt stop_reactorc syddkl‰Wntj odSXtpSddkl}ddkl}|d‡fd†ƒati t ƒti ƒnˆtfS( s³ Start the Twisted reactor in a separate thread, if not already done. Returns the reactor. The thread will automatically be destroyed when all the tests are done. iÿÿÿÿ(R(t threadable(tThreadttargetcsˆidtƒS(tinstallSignalHandlers(truntFalse((R(sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pyt8s N(NN( ttwisted.internetRt ImportErrortNonet_twisted_threadttwisted.pythonRt threadingR t setDaemontTruetstart(RR ((RsB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pyR*s cCs\d„}ti|ƒtiƒx/tiƒD]!}|iƒo|iƒq-q-WdadS(sStop the reactor and join the reactor thread until it stops. Call this function in teardown at the module or package level to reset the twisted system after your tests. You *must* do this if you mix tests using these tools and tests using twisted.trial. cSstiƒdS(s0Helper for calling stop from withing the thread.N(Rtstop(((sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pyRJsN( RtcallFromThreadtreactor_threadtjointgetDelayedCallstactivetcancelRR(Rtp((sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pyRBs     cs}tƒ\‰}ˆdjotdƒ‚nyˆdjpˆdWntj otdƒ‚nX‡‡fd†}|S(s By wrapping a test function with this decorator, you can return a twisted Deferred and the test will wait for the deferred to be triggered. The whole test function will run inside the Twisted event loop. The optional timeout parameter specifies the maximum duration of the test. The difference with timed() is that timed() will still wait for the test to end, while deferred() will stop the test when its timeout has expired. The latter is more desireable when dealing with network tests, because the result may actually never arrive. If the callback is triggered, the test has passed. If the errback is triggered or the timeout expires, the test has failed. Example:: @deferred(timeout=5.0) def test_resolve(): return reactor.resolve("www.python.org") Attention! If you combine this decorator with other decorators (like "raises"), deferred() must be called *first*! In other words, this is good:: @raises(DNSLookupError) @deferred() def test_error(): return reactor.resolve("xxxjhjhj.biz") and this is bad:: @deferred() @raises(DNSLookupError) def test_error(): return reactor.resolve("xxxjhjhj.biz") s1twisted is not available or could not be importedis+'timeout' argument must be a number or Nonecs+‡‡‡fd†}tˆƒ|ƒ}|S(Nc s¾tƒ‰‡fd†‰‡fd†‰‡‡‡‡‡‡fd†}ˆi|ƒyˆidˆƒ}Wn#tj otdˆƒ‚nX|dj o|\}}}|||‚ndS(NcsˆidƒdS(N(tputR(tvalue(tq(sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pytcallbackŠscs/y|iƒWnˆitiƒƒnXdS(N(traiseExceptionR tsystexc_info(tfailure(R"(sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pyterrbackŒsc sjyIˆˆˆŽ}y|iˆˆƒWntj otdƒ‚nXWnˆitiƒƒnXdS(Ns7you must return a twisted Deferred from your test case!(t addCallbackstAttributeErrort TypeErrorR R%R&(td(tkargstargsR"R#tfuncR((sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pytg’sttimeouts*timeout expired before end of test (%f s.)(RRtgetRRR(R.R-R0terrortexc_typet exc_valuettb(R/R1R(R-R.R"R#R(sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pytwrapperˆs   (R(R/R7(R1R(R/sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pytdecorate‡s"N(RRRR+(R1RR8((RR1sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pyRVs& %(t__doc__R%RRt nose.toolsRRt__all__RRRRRRR(((sB/opt/alt/python27/lib/python2.7/site-packages/nose/twistedtools.pyts