~~~~~
This release of testtools is perhaps the most interesting and exciting one
it's ever had. We've continued in bringing together the best practices of unit
testing from across a raft of different Python projects, but we've also
extended our mission to incorporating unit testing concepts from other
languages and from our own research, led by Robert Collins.
We now support skipping and expected failures. We'll make sure that you
up-call setUp and tearDown, avoiding unexpected testing weirdnesses. We're
now compatible with Python 2.5, 2.6 and 2.7 unittest library.
All in all, if you are serious about unit testing and want to get the best
thinking from the whole Python community, you should get this release.
Improvements
------------
* A new TestResult API has been added for attaching details to test outcomes.
This API is currently experimental, but is being prepared with the intent
of becoming an upstream Python API. For more details see pydoc
testtools.TestResult and the TestCase addDetail / getDetails methods.
* assertThat has been added to TestCase. This new assertion supports
a hamcrest-inspired matching protocol. See pydoc testtools.Matcher for
details about writing matchers, and testtools.matchers for the included
matchers. See http://code.google.com/p/hamcrest/.
* Compatible with Python 2.6 and Python 2.7
* Failing to upcall in setUp or tearDown will now cause a test failure.
While the base methods do nothing, failing to upcall is usually a problem
in deeper hierarchies, and checking that the root method is called is a
simple way to catch this common bug.
* New TestResult decorator ExtendedToOriginalDecorator which handles
downgrading extended API calls like addSkip to older result objects that
do not support them. This is used internally to make testtools simpler but
can also be used to simplify other code built on or for use with testtools.
* New TextTestResult supporting the extended APIs that testtools provides.
* Nose will no longer find 'runTest' tests in classes derived from
testtools.testcase.TestCase (bug 312257).
* Supports the Python 2.7/3.1 addUnexpectedSuccess and addExpectedFailure
TestResult methods, with a support function 'knownFailure' to let tests
trigger these outcomes.
* When using the skip feature with TestResult objects that do not support it
a test success will now be reported. Previously an error was reported but
production experience has shown that this is too disruptive for projects that
are using skips: they cannot get a clean run on down-level result objects.
.. _testtools: http://pypi.python.org/pypi/testtools