[TIP] RFC: Add TestResult.done()

Michael Foord fuzzyman at voidspace.org.uk
Wed Apr 8 09:02:16 PDT 2009


Robert Collins wrote:
> JML's testtools has a TestResult subclass with a done() method. The
> reason for this method is to allow doing things after the last test has
> run. 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 machines
> etc
>  - <your idea here>
>
>   

Sounds like a straightforward and useful feature request to me. Can you 
open an item on the Python bug tracker and either assign to me or add me 
as nosy (michael.foord).

Thanks

Michael

> This can be added quite safely I think - check for the attribute, and if
> present call it.
>
> done() could be spelt differently - I don't think anyone would care.
> testsFinished()
> finished()
> etc.
>
> I was prompted to send this mail, as I just needed to run some code in a
> TestResult after all the tests in a different project, and remembered
> its not part of the stdlib yet :)
>
> -Rob
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>   


-- 
http://www.ironpythoninaction.com/




More information about the testing-in-python mailing list