summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2013-08-16 12:50:14 +1200
committerRobert Collins <robertc@robertcollins.net>2013-08-16 12:50:14 +1200
commit9659b22fcc17420abaa946125e1c723c377fc46e (patch)
tree0b13908ff41771c5da731cfeedf50722acc64e6b
parent1ff98c654ba833d9dc2a442c7d3bce7c800d6958 (diff)
downloadfixtures-9659b22fcc17420abaa946125e1c723c377fc46e.tar.gz
* Documentation hopefully covers ``TestWithFixtures`` a little better.
(Robert Collins, #1102688)
-rw-r--r--NEWS3
-rw-r--r--README5
-rw-r--r--lib/fixtures/testcase.py3
3 files changed, 10 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 51a8db7..ec8b38f 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/README b/README
index cc51615..776c0c5 100644
--- a/README
+++ b/README
@@ -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):