Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue5728

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Support telling TestResult objects a test run has finished
Type:Stage:
Components:Library (Lib)Versions:Python 3.1, Python 2.7
process
Status:closedResolution:
Dependencies:Superseder:
Assigned To:Nosy List: barry, dgou, michael.foord, olemis, rbcollins
Priority:normalKeywords:patch

Created on2009-04-09 12:15 byrbcollins, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
start-stop-TestRun.patchrbcollins,2009-04-11 08:29
start-stop-TestRun.patchrbcollins,2009-04-17 00:16version2.patch
Messages (10)
msg85812 -(view)Author: Robert Collins (rbcollins)*(Python committer)Date: 2009-04-09 12:15
Original mail:JML's testtools has a TestResult subclass with a done() method. Thereason for this method is to allow doing things after the last test hasrun. While a result can infer 'first test' it can't infer 'last test'without ugliness like __del__.Some uses for this are: - reporting summary data - closing external resources like log files, sockets to remote machinesetc - <your idea here>This can be added quite safely I think - check for the attribute, and ifpresent call it.done() could be spelt differently - I don't think anyone would care.testsFinished()finished()etc.
msg85813 -(view)Author: Robert Collins (rbcollins)*(Python committer)Date: 2009-04-09 12:23
Now, some refinements, as usual (for me at least) when considering afeature like this from an upstream perspective, where one's immediateuse cases are just special cases not general case, I've come up withsome refinements.Firstly, I said you can infer starting. But its asymmetrical to have a'run is finished' method that unittest will call, and not a 'run isabout to start' method too. So I think we should have two methods,paired. This will avoid people having to write inference code themselvesevery time.Secondly, TestCase.run(None) creates a result. I think it would be goodto make a clear statement about who, and when should and will call thesetwo new methods. Something like:"Whomever calls 'start' is responsible for calling 'done'." Concretelythis means that when TestCase implicitly creates a TestResult, it willcall start, and also call done.Thirdly, naming. I'm agnostic, but I'd lean towards something clear, andsomething that can't be easily confused with startTest/stopTest. e.g.'startTestRun' and 'stopTestRun' (just pluralising 'Test' to 'Tests'would be easily confusable).If this all makes sense, I'll write up some tests and put a patchtogether. I'm pasting this into the issue to, for folk that watch issuesonly :).
msg85815 -(view)Author: Michael Foord (michael.foord)*(Python committer)Date: 2009-04-09 13:15
startTestRun and stopTestRun sound good to me.
msg85823 -(view)Author: Doug Philips (dgou)Date: 2009-04-09 18:53
Quite useful! Names are hard, but the ones proposed are pretty good.
msg85841 -(view)Author: Robert Collins (rbcollins)*(Python committer)Date: 2009-04-11 08:29
I've written up a patch for this; it works with old result classes too.Hopefully the bugtracker will attach it in reply to this mail; if notI'll put in via the webui this evening.-Rob
msg86005 -(view)Author: Barry A. Warsaw (barry)*(Python committer)Date: 2009-04-15 23:19
The patch looks fine to me, except that it's missing documentationupdates.  The feature and names are fine too.
msg86007 -(view)Author: Robert Collins (rbcollins)*(Python committer)Date: 2009-04-15 23:43
On Wed, 2009-04-15 at 23:19 +0000, Barry A. Warsaw wrote:> Barry A. Warsaw <barry@python.org> added the comment:> > The patch looks fine to me, except that it's missing documentation> updates.  The feature and names are fine too.Where do the docs go?-Rob
msg86011 -(view)Author: Barry A. Warsaw (barry)*(Python committer)Date: 2009-04-16 00:28
On Apr 15, 2009, at 7:43 PM, Robert Collins wrote:> Robert Collins <robertc@robertcollins.net> added the comment:>> On Wed, 2009-04-15 at 23:19 +0000, Barry A. Warsaw wrote:>> Barry A. Warsaw <barry@python.org> added the comment:>>>> The patch looks fine to me, except that it's missing documentation>> updates.  The feature and names are fine too.>> Where do the docs go?Doc/library/unittest.rst
msg86052 -(view)Author: Robert Collins (rbcollins)*(Python committer)Date: 2009-04-17 00:16
Updates - docs, and fixes a couple of stubbed out upcalls in the loggingresult put in while bootsrapping.
msg86987 -(view)Author: Michael Foord (michael.foord)*(Python committer)Date: 2009-05-02 22:44
Committed inrevision 72225.
History
DateUserActionArgs
2022-04-11 14:56:47adminsetgithub: 49978
2009-05-02 22:44:44michael.foordsetstatus: open -> closed

messages: +msg86987
2009-04-17 00:16:13rbcollinssetfiles: +start-stop-TestRun.patch

messages: +msg86052
2009-04-16 00:28:22barrysetmessages: +msg86011
2009-04-15 23:43:12rbcollinssetmessages: +msg86007
2009-04-15 23:19:46barrysetnosy: +barry
messages: +msg86005
2009-04-11 08:29:35rbcollinssetfiles: +start-stop-TestRun.patch
keywords: +patch
messages: +msg85841
2009-04-09 18:53:01dgousetnosy: +dgou
messages: +msg85823
2009-04-09 13:15:55michael.foordsetmessages: +msg85815
2009-04-09 12:23:12rbcollinssetmessages: +msg85813
2009-04-09 12:15:23rbcollinscreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp