[TIP] RFC: Add TestResult.done()

Olemis Lang olemis at gmail.com
Wed Apr 8 06:33:17 PDT 2009


On Wed, Apr 8, 2009 at 8:07 AM, Robert Collins
<robertc at robertcollins.net> 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>

- commiting test results to a RDBMS if considering storing test
results in a single transaction (all or nothing ;)

> This can be added quite safely I think - check for the attribute, and if
> present call it.
>

I give a big +0.75 for this ... :)

However I find out that TestResult has the following methods

{{{
>>> dir(unittest.TestResult)
['startTest', 'stop', 'stopTest', 'wasSuccessful', ...]
}}}

Isn't it enough ?

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Se retira el BDFL ... ¿El fin de Python 3k?
- http://feedproxy.google.com/~r/simelo-es/~3/HpncxTKfB1c/se-retira-el-bdfl-el-fin-de-python-3k_02.html



More information about the testing-in-python mailing list