You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SkipTest in tearDown is reported an as an error #54066
python3k.skipteardown.patch: Patch against the py3k branch to add support for handling SkipTest from the tearDown method
python27.skipteardown.patch: Patch against the release27-maint branch to add support for handling SkipTest from the tearDown method
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/voidspace'closed_at=<Date2010-12-19.03:24:16.081>created_at=<Date2010-09-14.21:45:16.650>labels= ['type-bug', 'library']
title='SkipTest in tearDown is reported an as an error'updated_at=<Date2010-12-19.03:25:05.134>user='https://github.com/pitrou'
Raising SkipTest when in a tearDown method is reported as an error, rather than a skipped test.
Now doing this sounds like a weird use case, but it would be actually useful when you have a worker thread, and the tearDown method collects the exception raised in that thread and raises it again. For the worker thread to be able to use skipTest(), a SkipTest exception raised in tearDown should be properly reported as a skip.
If the test has not yet failed this is fine. The problem is that if an exception has *already* been raised then it will already have been added to the result - so by then skipping is meaningless (or contradictory - the test can fail *and* skip).
MarkRoddy commented on Nov 7, 2010
MarkRoddymannequin
Mannequin
More actions
Attaching patch which adds support for registering a skip when raised from tearDown. Per Michael's point regarding failed tests, this is only handled if the test has been successful when SkipTest is raised from tearDown.
MarkRoddy commented on Nov 7, 2010
MarkRoddymannequin
Mannequin
More actions
Attaching patch which does the same as the previous for the release27-maint branch.
It is a stretch to see this as a bugfix rather than a new feature so probably *shouldn't* be backported to 2.7. On the other hand the fix is combined with the fix for bpo-9857 which *is* a bugfix and *should* be backported to Python 2.7.
Activity
pitrou commentedon Sep 14, 2010
Raising SkipTest when in a tearDown method is reported as an error, rather than a skipped test.
Now doing this sounds like a weird use case, but it would be actually useful when you have a worker thread, and the tearDown method collects the exception raised in that thread and raises it again. For the worker thread to be able to use skipTest(), a SkipTest exception raised in tearDown should be properly reported as a skip.
voidspace commentedon Sep 15, 2010
Interesting use case.
If the test has not yet failed this is fine. The problem is that if an exception has *already* been raised then it will already have been added to the result - so by then skipping is meaningless (or contradictory - the test can fail *and* skip).
MarkRoddy commentedon Nov 7, 2010
Attaching patch which adds support for registering a skip when raised from tearDown. Per Michael's point regarding failed tests, this is only handled if the test has been successful when SkipTest is raised from tearDown.
MarkRoddy commentedon Nov 7, 2010
Attaching patch which does the same as the previous for the release27-maint branch.
voidspace commentedon Dec 19, 2010
Committed revision 87390.
It is a stretch to see this as a bugfix rather than a new feature so probably *shouldn't* be backported to 2.7. On the other hand the fix is combined with the fix for bpo-9857 which *is* a bugfix and *should* be backported to Python 2.7.
voidspace commentedon Dec 19, 2010
Correction, the fix is combined with the fix for bpo-10611.