TestCase.skipTest() will raise a SkipTest exception, which is not caught in _cleaning_debug, so the _post_teardown() call is skipped. Also apparently cleanups registered with TestCase.addCleanup() will not be run. If setup done in _pre_setup needs to be undone in _post_teardown (or in cleanups scheduled with addCleanup()), that will not happen for tests skipped with skipTest().
This does not apply to tests skipped with a @unittest.skip decorator.
For comparison, nose runs _post_teardown methods for tests skipped with skipTest().
TestCase.skipTest()will raise aSkipTestexception, which is not caught in_cleaning_debug, so the_post_teardown()call is skipped. Also apparently cleanups registered withTestCase.addCleanup()will not be run. If setup done in_pre_setupneeds to be undone in_post_teardown(or in cleanups scheduled withaddCleanup()), that will not happen for tests skipped withskipTest().This does not apply to tests skipped with a
@unittest.skipdecorator.For comparison,
noseruns_post_teardownmethods for tests skipped withskipTest().