New submission from Tim Cuthbertson <tim3d.j...@gmail.com>:

This patch adds the behaviour that when a unittest.failureException is
thrown in a TestCase's tearDown method, the test case is added to the
failures list (instead of the errors list, and only when the test case
body has passed successfully).

In some circumstances, tests may want to assert that something happens
at some point during the body of a test, and the best time to make these
checks can be in the tearDown method.

This is a modification I've made during development of my mocktest
library (https://github.com/gfxmonk/mocktest/tree), and I believe it is
beneficial to have as the default unittest behaviour.

----------
components: Extension Modules
files: unittest-fail-on-teardown-0.patch
keywords: patch
messages: 83927
nosy: gfxmonk
severity: normal
status: open
title: unittest: allow failures in tearDown method
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file13387/unittest-fail-on-teardown-0.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5531>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to