[issue5679] cleanUp stack for unittest

Jonathan Lange report at bugs.python.org
Mon Apr 6 06:53:45 CEST 2009


Jonathan Lange <jml at mumak.net> added the comment:

On Mon, Apr 6, 2009 at 2:16 PM, Kumar McMillan <report at bugs.python.org> wrote:
>
> Kumar McMillan <kumar.mcmillan at gmail.com> added the comment:
>
> I like this patch.  However, a nice-to-have would be that _doCleanups()
> prints a traceback from function(*args, **kwargs) (if there is one) the
> same way that atexit does.  That would aid in debugging mis-written
> cleanup functions yet would not intrude on your test program.
>

I think reporting the errors via addError is the right thing. If your
cleanups fail, then your test suite becomes unreliable, so they should
be treated like tests that raise unexpected errors.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5679>
_______________________________________


More information about the Python-bugs-list mailing list