[issue24694] callables registered in TestCase.addCleanup should be run before tearDown

Charles-François Natali report at bugs.python.org
Thu Jul 23 16:05:36 CEST 2015


Charles-François Natali added the comment:

I understand the risk of breakeage, but that's still broken, because
we break LIFO ordering.

I'd been using addCleanup() for years and never bothered looking at
the documentation - which is admitedly a mistake - because LIFO
ordering is the natural behavior: since addCleanup() is called once
the test has been entered - so after setUp, logic would expect it to
be undone before tearDown.

But I guess that ship has sailed...

----------

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


More information about the Python-bugs-list mailing list