Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unittest: have to subclass TextTestRunner to use alternative TestResult #52141

Closed
voidspace opened this issue Feb 9, 2010 · 2 comments
Closed
Assignees
Labels
easy extension-modules C modules in the Modules dir

Comments

@voidspace
Copy link
Contributor

BPO 7893
Nosy @voidspace, @briancurtin

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/voidspace'
closed_at = <Date 2010-02-10.15:56:21.521>
created_at = <Date 2010-02-09.17:11:42.787>
labels = ['extension-modules', 'easy']
title = 'unittest: have to subclass TextTestRunner to use alternative TestResult'
updated_at = <Date 2010-02-10.15:56:21.486>
user = 'https://github.com/voidspace'

bugs.python.org fields:

activity = <Date 2010-02-10.15:56:21.486>
actor = 'michael.foord'
assignee = 'michael.foord'
closed = True
closed_date = <Date 2010-02-10.15:56:21.521>
closer = 'michael.foord'
components = ['Extension Modules']
creation = <Date 2010-02-09.17:11:42.787>
creator = 'michael.foord'
dependencies = []
files = []
hgrepos = []
issue_num = 7893
keywords = ['easy']
message_count = 2.0
messages = ['99129', '99169']
nosy_count = 2.0
nosy_names = ['michael.foord', 'brian.curtin']
pr_nums = []
priority = 'normal'
resolution = 'accepted'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue7893'
versions = ['Python 2.7', 'Python 3.2']

@voidspace
Copy link
Contributor Author

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.

@voidspace voidspace self-assigned this Feb 9, 2010
@voidspace voidspace added extension-modules C modules in the Modules dir easy labels Feb 9, 2010
@voidspace
Copy link
Contributor Author

Fixed revision 78130.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy extension-modules C modules in the Modules dir
Projects
None yet
Development

No branches or pull requests

1 participant