[TIP] addCleanup for setUpClass()?
tsp at apache.org
Thu Aug 1 03:28:30 PDT 2013
On Thu, Aug 01, 2013 at 02:53:51PM +0530, Prasanna Santhanam wrote:
> In unittest with the fix for  unittest.addCleanups can perform
> cleanup for objects in the LIFO structure if setUp fails midway during
> an expensive test. Is there something similar for setUpClass() as well
> that was introduced with unittest2?
> If not - would something like the following work?
> def setUpClass(cls)
Specifically I attempted this:
But I see it has no effect at all on the tests implemented using MyTestClass.
My last resort would be to include the try..except block into every test :/
Powered by BigRock.com
More information about the testing-in-python