/usr/lib/python2.6/site-packages/nose
NameSizeModeActions
ext/-0755rm
plugins/-0755rm
case.py125080644editdlrm
case.pyc142820644editdlrm
case.pyo142820644editdlrm
commands.py45700644editdlrm
commands.pyc50030644editdlrm
commands.pyo50030644editdlrm
config.py202030644editdlrm
config.pyc198900644editdlrm
config.pyo198900644editdlrm
core.py171750644editdlrm
core.pyc175490644editdlrm
core.pyo175490644editdlrm
exc.py3760644editdlrm
exc.pyc5760644editdlrm
exc.pyo5760644editdlrm
failure.py8500644editdlrm
failure.pyc13670644editdlrm
failure.pyo13670644editdlrm
importer.py54900644editdlrm
importer.pyc50940644editdlrm
importer.pyo50940644editdlrm
inspector.py69040644editdlrm
inspector.pyc59250644editdlrm
inspector.pyo59250644editdlrm
loader.py214370644editdlrm
loader.pyc160800644editdlrm
loader.pyo160800644editdlrm
proxy.py58400644editdlrm
proxy.pyc73270644editdlrm
proxy.pyo71200644editdlrm
result.py58490644editdlrm
result.pyc59130644editdlrm
result.pyo59130644editdlrm
selector.py90030644editdlrm
selector.pyc88760644editdlrm
selector.pyo88760644editdlrm
suite.py186930644editdlrm
suite.pyc186630644editdlrm
suite.pyo186630644editdlrm
tools.py50230644editdlrm
tools.pyc72090644editdlrm
tools.pyo71290644editdlrm
twistedtools.py52680644editdlrm
twistedtools.pyc58150644editdlrm
twistedtools.pyo58150644editdlrm
util.py192750644editdlrm
util.pyc201250644editdlrm
util.pyo201250644editdlrm
__init__.py149850644editdlrm
__init__.pyc152830644editdlrm
__init__.pyo152830644editdlrm
Edit: /usr/lib/python2.6/site-packages/nose/twistedtools.pyc (5815B)
Ñò š}êGc@sŠdZddkZddklZlZddklZlZddddd gZda d „Z e ƒ\Z Z d „Z dd „ZdS( sH 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 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(s5/usr/lib/python2.6/site-packages/nose/twistedtools.pyt6s N(NN( ttwisted.internetRt ImportErrortNonet_twisted_threadttwisted.pythonRt threadingR t setDaemontTruetstart(RR ((Rs5/usr/lib/python2.6/site-packages/nose/twistedtools.pyR(s cCstiƒtiƒdadS(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. N(Rtstoptreactor_threadtjoinRR(((s5/usr/lib/python2.6/site-packages/nose/twistedtools.pyR@s  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("nose.python-hosting.com") 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(s5/usr/lib/python2.6/site-packages/nose/twistedtools.pytcallback€scs/y|iƒWnˆitiƒƒnXdS(N(traiseExceptionRtsystexc_info(tfailure(R(s5/usr/lib/python2.6/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 TypeErrorRR R!(td(tkargstargsRRtfuncR#(s5/usr/lib/python2.6/site-packages/nose/twistedtools.pytgˆsttimeouts*timeout expired before end of test (%f s.)(RtcallFromThreadtgetRRR(R)R(R+terrortexc_typet exc_valuettb(R*R,R(R(R)RRR#s5/usr/lib/python2.6/site-packages/nose/twistedtools.pytwrapper~s   (R(R*R3(R,R(R*s5/usr/lib/python2.6/site-packages/nose/twistedtools.pytdecorate}s"N(RRRR&(R,RR4((RR,s5/usr/lib/python2.6/site-packages/nose/twistedtools.pyRLs& %(t__doc__R RRt nose.toolsRRt__all__RRRRRRR(((s5/usr/lib/python2.6/site-packages/nose/twistedtools.pyts