<br><br><div class="gmail_quote">On Jan 28, 2008 4:09 PM, Jean-Paul Calderone <<a href="mailto:exarkun@divmod.com">exarkun@divmod.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Mon, 28 Jan 2008 11:09:44 +0100, holger krekel <<a href="mailto:holger@merlinux.de">holger@merlinux.de</a>> wrote:<br>>Hi Ralf,<br>><br>>On Mon, Jan 28, 2008 at 05:53 +0100, Ralf Schmitt wrote:<br>
>> On Jan 26, 2008 1:39 PM, holger krekel <<a href="mailto:holger@merlinux.de">holger@merlinux.de</a>> wrote:<br>>> ><br>>> > I could use contributions or help (or sometimes just hints) in<br>
>> > the following particular areas:<br>>> ><br>>> > - integrating py.test with Twisted<br>>><br>>><br>>> <a href="http://systemexit.de/repo/py.test.twisted/" target="_blank">http://systemexit.de/repo/py.test.twisted/</a> contains a mercurial repository,<br>
>> which makes testing code running under the twisted reactor possible. (I've<br>>> already asked about integrating it into the py library).<br><br></div>Is it intentional that this integration busy-loops, guaranteeing 100% CPU<br>
usage for the entire test-run?<br><font color="#888888"></font></blockquote><div><br>Why do you think so? Apparently this isn't true on my machine:<br><br>~/py.test.twisted/ cat test_some.py ralf@red ok<br>
#! /usr/bin/env py.test.twisted<br><br>from twisted.internet import defer, reactor<br>from twisted.python import failure<br>from twisted.python import log<br><br>def test_deferred():<br> d = defer.Deferred()<br> def done():<br>
log.msg("done")<br> d.callback(None)<br> <br> reactor.callLater(25, done)<br> log.msg("Returning %r" % (d,))<br> return d<br><br>def test_defer_fail():<br> def fun():<br>
log.msg("provoking NameError")<br> rsdfg<br> return defer.maybeDeferred(fun)<br>~/py.test.twisted/ time ./py.test.twisted test_some.py ralf@red ok<br>2008-01-29 07:01:14+0100 [-] Log opened.<br>
============================= test process starts ==============================<br>executable: /home/ralf/py25/bin/python (2.5.2-alpha-0)<br>using py lib: /home/ralf/py25/lib/python2.5/site-packages/py-0.9.0-py2.5.egg/py <rev unknown><br>
<br>test_some.py[2] .F<br><br>________________________________________________________________________________<br>_________________________ entrypoint: test_defer_fail __________________________<br><br> def fun():<br> log.msg("provoking NameError")<br>
E rsdfg<br>> NameError: global name 'rsdfg' is not defined<br><br>[/home/ralf/py.test.twisted/test_some.py:20]<br>- - - - - - - - - - - test_defer_fail: recorded stdout - - - - - - - - - - - -<br>2008-01-29 07:01:39+0100 [-] provoking NameError<br>
<br>________________________________________________________________________________<br>============= tests finished: 1 passed, 1 failed in 25.00 seconds ==============<br>2008-01-29 07:01:39+0100 [-] Main loop terminated.<br>
./py.test.twisted test_some.py 0.22s user 0.06s system 1% cpu 25.278 total<br><br><br></div></div>