New submission from Robert Collins:

TextTestRunner calls str(TestCase) directly, which makes it hard for 
testscenarios to rename the test cases as it parameterises them (because 
__str__ is a descriptor). While testscenarios could use a decorator instead, 
thats undesirable as the test case object would still need to be customised so 
that calls to self.id() and self.shortDescription() inside it still return 
consistent information.

So the relevant code is this:
 def getDescription(self, test):
41 if self.descriptions:
42 return test.shortDescription() or str(test)
43 else:
44 return str(test)

What I'd like is to have this be something like:
41 if self.descriptions:
42     return test.shortDescription() or test.id()
43 else:
44     return test.id()

Which would let testscenarios adjust both shortDescriptions and id, and Just 
Work.

----------
messages: 173352
nosy: michael.foord, rbcollins
priority: normal
severity: normal
status: open
title: TextTestResult uses TestCase.__str__() which isn't customisable (vs id() 
or shortDescription())
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16288>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to