[Checkins] SVN: manuel/trunk/src/manuel/ make manuel.testing.TestCase.id return sensible text at all times
Chris Withers
chris at simplistix.co.uk
Thu Sep 2 11:51:15 EDT 2010
Log message for revision 116145:
make manuel.testing.TestCase.id return sensible text at all times
Changed:
U manuel/trunk/src/manuel/bugs.txt
U manuel/trunk/src/manuel/testing.py
-=-
Modified: manuel/trunk/src/manuel/bugs.txt
===================================================================
--- manuel/trunk/src/manuel/bugs.txt 2010-09-02 15:38:40 UTC (rev 116144)
+++ manuel/trunk/src/manuel/bugs.txt 2010-09-02 15:51:14 UTC (rev 116145)
@@ -179,3 +179,20 @@
True
>>> m3.debug
True
+
+TestCase id methods
+-------------------
+
+Twisted's testrunner, trial, makes use of the :meth:`id` method of
+:class:`TestCase` instances in a way that requires it to be a
+meaningful string.
+
+For :class:`manuel.testing.TestCase` instances, this used to return
+``None``. As you can see below, the
+:meth:`manuel.testing.TestCase.shortDescription` is now returned
+instead:
+
+>>> from manuel.testing import TestCase
+>>> m = manuel.Manuel()
+>>> print TestCase(m,manuel.RegionContainer(),None).id()
+<memory>
Modified: manuel/trunk/src/manuel/testing.py
===================================================================
--- manuel/trunk/src/manuel/testing.py 2010-09-02 15:38:40 UTC (rev 116144)
+++ manuel/trunk/src/manuel/testing.py 2010-09-02 15:51:14 UTC (rev 116145)
@@ -51,16 +51,13 @@
def countTestCases(self):
return len([r for r in self.regions if r.parsed])
- def id(self):
- return self.regions.id
-
def shortDescription(self):
if self.regions.id:
return self.regions.location + ':' + self.regions.id
else:
return self.regions.location
- __str__ = __repr__ = shortDescription
+ __str__ = __repr__ = id = shortDescription
def group_regions_by_test_case(document):
More information about the checkins
mailing list