classification
Title: unittest.TestCase.run should return result
Type: behavior Stage: resolved
Components: Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: michael.foord Nosy List: ezio.melotti, jonathan.hartley, michael.foord, python-dev
Priority: normal Keywords: patch

Created on 2011-03-05 13:43 by michael.foord, last changed 2011-03-14 23:02 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
issue11407.patch jonathan.hartley, 2011-03-14 19:41 patch to rev 68429:3b489e6beebb review
Messages (3)
msg130120 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2011-03-05 13:43
If you call TestCase.run without an argument it will create a default TestResult and use it to execute the test. It should return the result so that you can introspect it.
msg130882 - (view) Author: Jonathan Hartley (jonathan.hartley) * Date: 2011-03-14 19:41
Attached patch fixes this.

TestCase.run now returns its TestResult object, regardless of whether it was passed in or created internally. Test assertions added for this. Invoking an instance of TestCase already returned the return value of .run, so the result is correctly propagated. New test added that verifies that .__call__ delegates to .run.

Fix for an unrelated minor typo in the docs also bundled into this patch: Fixed the versionchanged:: markup for class TestCase.

This is my first patch submission, please help me out if I mess it up. Thanks.
msg130924 - (view) Author: Roundup Robot (python-dev) Date: 2011-03-14 23:02
New changeset b0b7d1d2354c by Michael Foord in branch 'default':
Closes issue 11407. TestCase.run returns the result object used or created
http://hg.python.org/cpython/rev/b0b7d1d2354c
History
Date User Action Args
2011-03-14 23:02:35python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg130924

resolution: fixed
stage: resolved
2011-03-14 19:41:41jonathan.hartleysetfiles: + issue11407.patch

nosy: + jonathan.hartley
messages: + msg130882

keywords: + patch
2011-03-05 13:44:06ezio.melottisetnosy: + ezio.melotti
2011-03-05 13:43:31michael.foordcreate