[Twisted-Python] Running Twisted tests with testtools
jml at mumak.net
Mon Feb 6 10:48:01 EST 2012
I'm the nominal maintainer of Trial. I'm also an active maintainer of
testtools is, roughly speaking, a base TestCase that works across a
bunch of Pythons and has a few nice features. I started to prefer
it over Twisted's TestCase some time ago, and now use it pretty
consistently, even for my Twisted code.
testtools has a way of letting you run tests within the Twisted
reactor, without needing to use a particular base class. For example::
run_tests_with = AsynchronousDeferredRunTest
It doesn't behave exactly the way Trial does. Freed from backwards
compatibility constraints, I tightened up the implementation quite a
bit. There are options to make it emulate Trial's behaviour.
The documentation says that it's "highly experimental". This is not
strictly true any more, as it has been used in numerous projects and
has been found to be quite robust.
The key source code is at::
And you can get the code from PyPI or Launchpad.
testtools has had this feature for some time now. It's past time that
I officially informed the Twisted community about it. That's the main
reason for this email.
In my ideal world, Twisted's TestCase would inherit from testtools's
TestCase and would continue to provide the same API it does today.
This might not be everyone else's ideal though, and the path from here
to there is unclear to me. I welcome your thoughts.
 http://testtools.rtfd.org ; http://pypi.python.org/pypi/testtools
 bzr branch lp:testtools
More information about the Twisted-Python