[Twisted-Python] Testing with trial, adbapi questions

Brendon Colby brendoncolby at gmail.com
Mon Jul 23 17:06:59 EDT 2007

On 7/23/07, Christian Simms <christian.simms at gmail.com> wrote:
> To fix your unit tests to "wait" until your data is loaded by your
> loadDevelopers method, you need to have your setUp method return the
> Deferred created by loadDevelopers's. There are a bunch of ways to do this,
> the simplest is probably to have your factory's __init__ method store the
> Deferred created by loadDevelopers into a member variable (say
> self.deferred), and then add a new line to the end of your setUp method
> above:
>            return self.deferred
> This way, each unit test will not start until the Deferred from
> loadDevelopers fires.

That worked! I was so close to this over the weekend too. I'm starting to
feel as though I need an MIT degree to understand this stuff. :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070723/dca9a5e1/attachment.htm 

More information about the Twisted-Python mailing list