diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | lib/fixtures/testcase.py | 3 |
3 files changed, 10 insertions, 1 deletions
@@ -9,6 +9,9 @@ NEXT CHANGES ------- +* Documentation hopefully covers ``TestWithFixtures`` a little better. + (Robert Collins, #1102688) + * ``FakePopen`` now accepts all the parameters available in Python 2.7. (Robert Collins) @@ -173,7 +173,10 @@ cleanup, and return the fixture. This lets one write:: >>> import unittest Note that we use testtools TestCase here as we need to guarantee a -TestCase.addCleanup method. +TestCase.addCleanup method in this doctest. Unittest2 - Python2.7 and above - +also have ``addCleanup``. testtools has it's own implementation of +``useFixture`` so there is no need to use ``fixtures.TestWithFixtures`` with +``testtools.TestCase``. >>> class NoddyTest(testtools.TestCase, fixtures.TestWithFixtures): ... def test_example(self): diff --git a/lib/fixtures/testcase.py b/lib/fixtures/testcase.py index 6a84ddf..1d6a85c 100644 --- a/lib/fixtures/testcase.py +++ b/lib/fixtures/testcase.py @@ -26,6 +26,9 @@ class TestWithFixtures(unittest.TestCase): """A TestCase with a helper function to use fixtures. Normally used as a mix-in class to add useFixture. + + Note that test classes such as testtools.TestCase which already have a + ``useFixture`` method do not need this mixed in. """ def useFixture(self, fixture): |