[Twisted-Python] Re: Hanging test cases (Was: Evangelism notes...)

David Bolen db3l at fitlinxx.com
Wed May 11 19:34:15 EDT 2005


Christopher Armstrong <radeex at gmail.com> writes:

> Uhhh, maybe I'm missing something here, but as I understand it (I
> probably should, being the guy who wrote deferredgenerators), that
> code is:
> 
>     testCase = deferredGenerator(testCase)
> 
> after the definition of the method, or even:
> 
>     @deferredGenerator
> 
> before the definition of the method.

But then who actually performs the iteration over the test case to
trigger the generator?  Clearly some top level code needs to invoke
the reactor.run() and at some point iterate over testCase while
beneath a running reactor.  We're just using unittest, so something
would need to be added to serve as the basic framework for that sort
of test.

I'm guessing from your uncertainty that trial - which I haven't kept
up with changes for 2.0 - probably provides a mode to do this
automatically, so if I were using trial you'd be correct and it
wouldn't be that much more work to integrate the new deferred
generator support into the tests.

Note that independent of use in tests, I'm definitely intrigued by
these techniques (as I was in the early flow support in Twisted 1.x)
so when we start the migration to 2.0 we'll probably look at
incorporating this approach into the code base when reasonable.

-- David





More information about the Twisted-Python mailing list