[Twisted-Python] Help with trial test failure

Glyph glyph at twistedmatrix.com
Tue Aug 6 00:28:04 MDT 2013


On Aug 5, 2013, at 2:09 AM, Benjamin BERTRAND <beenje at gmail.com> wrote:

> That's why the inlineCallbacks solves the problem. When I yield on the self.server.dataReceived, I wait for the deferred in the publish methods to fire and everything is clean when I close the connection.
> 
> Is there another way to do that?

Jonathan Lange wrote about this a long time ago:

http://blackjml.livejournal.com/23029.html

but better than doing that would be to avoid setting up and tearing down real TCP connections during your tests.  Those are slower than an in-memory thing (like you would get from twisted.test.proto_helpers, the one and only public module in our 'test' package) and also, as you have discovered, more unpredictable.

Is there any way to hand txredis a synthetic transport for testing?  If not, file a bug on it :).

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130805/f5878ab9/attachment.html>


More information about the Twisted-Python mailing list