Changes
-------
- * Removed a number of code paths where Python 2.4 and Python 2.5 were
- explicitly handled. (Daniel Watkins)
+ * Make testtools compatible with the ``unittest.expectedFailure`` decorator in
+ Python 3.4. (Thomi Richards)
+Improvements
+------------
+
+* Introduce the assert_that function, which allows matchers to be used
+ independent of testtools.TestCase. (Daniel Watkins, #1243834)
+
++
+ 0.9.35
+ ~~~~~~
+
+ Changes
+ -------
+
+ * Removed a number of code paths where Python 2.4 and Python 2.5 were
+ explicitly handled. (Daniel Watkins)
+
+ Improvements
+ ------------
+
+ * Added the ``testtools.TestCase.expectThat`` method, which implements
+ delayed assertions. (Thomi Richards)
+
+ * Docs are now built as part of the Travis-CI build, reducing the chance of
+ Read The Docs being broken accidentally. (Daniel Watkins, #1158773)
+
0.9.34
~~~~~~
self.assertNotEqual(result, 50)
+``assert_that`` Function
+------------------------
+
+In addition to ``self.assertThat``, testtools also provides the ``assert_that``
+function in ``testtools.assertions`` (which is what ``self.assertThat`` backs
+on to internally). This behaves as the method version does::
+
+ class TestSquare(TestCase):
+
+ def test_square():
+ result = square(7)
+ assert_that(result, Equals(49))
+
+ def test_square_silly():
+ result = square(7)
+ assert_that(result, Not(Equals(50)))
+
+
++=======
+ Delayed Assertions
+ ~~~~~~~~~~~~~~~~~~
+
+ A failure in the ``self.assertThat`` method will immediately fail the test: No
+ more test code will be run after the assertion failure.
+
+ The ``expectThat`` method behaves the same as ``assertThat`` with one
+ exception: when failing the test it does so at the end of the test code rather
+ than when the mismatch is detected. For example::
+
+ import subprocess
+
+ from testtools import TestCase
+ from testtools.matchers import Equals
+
+
+ class SomeProcessTests(TestCase):
+
+ def test_process_output(self):
+ process = subprocess.Popen(
+ ["my-app", "/some/path"],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE
+ )
+
+ stdout, stderrr = process.communicate()
+
+ self.expectThat(process.returncode, Equals(0))
+ self.expectThat(stdout, Equals("Expected Output"))
+ self.expectThat(stderr, Equals(""))
+
+ In this example, should the ``expectThat`` call fail, the failure will be
+ recorded in the test result, but the test will continue as normal. If all
+ three assertions fail, the test result will have three failures recorded, and
+ the failure details for each failed assertion will be attached to the test
+ result.
+
Stock matchers
--------------