This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: unittest: have to subclass TextTestRunner to use alternative TestResult
Type: Stage: resolved
Components: Extension Modules Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: michael.foord Nosy List: brian.curtin, michael.foord
Priority: normal Keywords: easy

Created on 2010-02-09 17:11 by michael.foord, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg99129 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-02-09 17:11
A common way to extend unittest is to implement a custom TestResult. Currently you have to subclass TextTestRunner, overriding _makeResult, to get it to use an alternative result class.

I suggest adding an additional, optional, argument to TextTestRunner to specify an alternative result class (or callable) that will be used by _makeResult. This will permit the use of custom test result objects without having to subclass.
msg99169 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-02-10 15:56
Fixed revision 78130.
History
Date User Action Args
2022-04-11 14:56:57adminsetgithub: 52141
2010-02-10 15:56:21michael.foordsetstatus: open -> closed
resolution: accepted
messages: + msg99169

stage: needs patch -> resolved
2010-02-09 17:45:59brian.curtinsetnosy: + brian.curtin
2010-02-09 17:11:42michael.foordcreate