[TIP] setUp and tearDown behavior
olemis at gmail.com
Tue Jan 19 06:53:03 PST 2010
On Tue, Jan 19, 2010 at 9:32 AM, John Arbash Meinel
<john at arbash-meinel.com> wrote:
> Michael Foord wrote:
>> On 19/01/2010 13:53, Olemis Lang wrote:
>>>> In case this is expected, is there a way to do it just once for all the
>>> Using standard `unittest` module ? well ... no.
>> Well - you can make setup *effectively* only run the first time using a
>> class attribute:
> I believe we handle it using "startTestRun()" and "stopTestRun()" but
> those are defined for the whole test suite, not for a subset.
> A different possibility with the "test_suite()" or "load_tests()"
> paradigm, is that you can create a custom TestSuite instance that
> overloads run() (I believe) to do something like:
> class MySuite(unittest.TestSuite):
> def run(self):
+1 , something like what I mentioned before (/we shooting almost at
the same time ;o) and implemented before _
I just wanted to say that «the "test_suite()" or "load_tests()"
paradigm» are not needed to do that. Can be done using a custom test
..  dutest.DocTestSuiteFixture class @ SF.net
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Now `dutest` 1.2.3 is easy_install-able o -
More information about the testing-in-python