chevah/empirical — pull request #28 by adiroiban (2014-03-03 21:01:32+00:00)
Title: [#2016] Support addCleanup calls before tearDown.

Problem description
===================

the standard python implementation of addCleanup calls addCleanup after tearDown is called due to class hierarchy.

We want addCleanup to be called before tearDown.

Changes description
===================

Implement custom addCleanup method and an explicit callCleanup method.

We need explicit callCleanup as otherwise when sub-classing the base TestCase, addCleanup will also be called after sub-class tearDown.

Event if we have addCleanup support in EmpiricalTestCase, classed inheriting from it should explicitly call callCleanup to force cleanup methods before the rest of tearDown code.

It contains a cleanup for code which was not used.

How to try and test the changes
===============================

reviewers @alibotean

check that changes make sense.

Thanks!