[Twisted-Python] Running twisted.trial unittests using nose
Chris Miles
miles.chris at gmail.com
Mon Aug 6 08:10:53 MDT 2007
On 6 Aug 2007, at 14:20, glyph at divmod.com wrote:
> On 12:17 pm, miles.chris at gmail.com wrote:
>> I'm simply curious as to whether it is safe for me to rely on a
>> test runner other than "trial" to run the tests? I assume any
>> magic (knowledge of deferreds) is within the
>> twisted.trial.unittest.TestCase class and the "trial" command is
>> simply another tool to discover and pretty print the results.
>> From what I've seen, both "nosetests" and "trial" will produce
>> the same report (although "trial" looks nicer :-). Or perhaps
>> this wouldn't be the case if I needed to interact with the reactor?
>
> There is an implicit, undocumented goal that tests written for
> trial should remain usable with other test runners. Recently, I
> filed a ticket because not even *I* know which test runners or how
> this is supposed to work. You can follow the discussion /
> resolution here:
>
> http://twistedmatrix.com/trac/ticket/2739
>
> Personally I'd never use nose because, as you say, trial looks
> nicer :), so I can only guess what's going wrong.
>
> The potential problem (currently) with using Twisted's TestCase
> class together with other runners is that the tests do something
> that no other Twisted application does, and which is not _really_
> supported by the framework: re-start the reactor repeatedly.
Thanks glyph, this was the answer I was expecting. Not an issue for
me, it is just nice to know what is "supposed" to work and what isn't
guaranteed to.
I have documented my project as requiring "trial" (the command) to
run the tests, with a note that even though the tests pass when using
"nosetests" (or another test runner) that may not be always reliable.
Cheers,
Chris Miles
More information about the Twisted-Python
mailing list