Skip to content

TestCase.skipTest() skips _post_teardown #772

Closed
@lanzz

Description

@lanzz

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions