[Twisted-Python] Testing with trial, adbapi questions

Brendon Colby brendoncolby at gmail.com
Tue Jun 26 17:50:45 EDT 2007


On 6/26/07, Christian Simms <christian.simms at gmail.com> wrote:
> Looks like I mis-assumed your problem, sorry.  In the setUp method in your
> tests, you should return a Deferred which fires when all your data is
> loaded.  This can be a pain if you already organized your code into classes
> inheriting from twisted.application.service.Service which
> have startService/stopService calls. It's a pain because trial doesn't
> create an application object like running inside twistd does.  So, in the
> case of writing unit tests for applications, you can abstract out your
> initialization code into a method, and then call that method directly in
> your setUp method.

OK - I will work on this and see if I can figure it out. Thanks for the tip.

Brendon




More information about the Twisted-Python mailing list