classification
Title: unittest.TestCase.shortDescription isn't short anymore
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: michael.foord Nosy List: brian.curtin, exarkun, ezio.melotti, gregory.p.smith, michael.foord
Priority: normal Keywords:

Created on 2009-12-28 14:30 by exarkun, last changed 2010-02-10 15:54 by michael.foord. This issue is now closed.

Messages (6)
msg96948 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2009-12-28 14:30
Sometime between Python 2.6 and 2.7a1, the
unittest.TestCase.shortDescription method changed from returning just
the test method name to the test method name, in parentheses, the fully
qualified Python name of the test case.

This breaks several Twisted unit tests and, I think, goes against the
expectations users have of the "shortDescription" method.
msg96953 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-12-28 15:07
Personally I agree. I'll see if I can find the change (don't think it
was me) and see if there was some kind of rationale.
msg97000 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2009-12-29 19:18
It looks like this was changed in r70837
msg98917 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-02-05 23:00
The problem this fix was trying to fix was that if you provide a docstring for your test then the test name is ommitted in the report.

This could be fixed in the _TextTestResult instead - changing the getDescription() method to always include str(test).
msg98932 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2010-02-06 04:15
I agree that changing the result object is a better way to implement this feature: if the results object wants to report things by *name*, not *description*, then it should get the test's *name*, not rely on changing the meaning of the test's description method.
msg99168 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-02-10 15:54
Fixed revision 78130.
History
Date User Action Args
2010-02-10 15:54:43michael.foordsetstatus: open -> closed
resolution: accepted
messages: + msg99168

stage: needs patch -> resolved
2010-02-06 12:07:03michael.foordsetnosy: + gregory.p.smith
2010-02-06 04:15:28exarkunsetmessages: + msg98932
2010-02-05 23:00:21michael.foordsetmessages: + msg98917
2010-01-13 05:22:47ezio.melottisetnosy: + ezio.melotti
2010-01-13 03:01:08brian.curtinsetstage: needs patch
2009-12-29 21:23:23brett.cannonsetassignee: michael.foord
2009-12-29 19:18:21brian.curtinsetnosy: + brian.curtin
messages: + msg97000
2009-12-28 15:07:27michael.foordsetmessages: + msg96953
2009-12-28 14:46:13r.david.murraysetpriority: normal
nosy: + michael.foord
2009-12-28 14:30:40exarkuncreate