This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients neologix
Date 2015-07-23.13:43:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437658984.72.0.371299012028.issue24694@psf.upfronthosting.co.za>
In-reply-to
Content
Consider this code:

-----------------------------------------------------
from __future__ import print_function

from pyccp.unittest import SafeTestCase


class MyTest(SafeTestCase):

    def setUp(self):
        print("setUp")

    def tearDown(self):
        print("tearDown")

    def test(self):
        print("creating")
        self.addCleanup(lambda: print("destroying"))
-----------------------------------------------------


When run:

setUp
creating
tearDown
destroying


We lose the LIFO ordering between between setUP and addCleanup, which is highly counter-intuitive, and almost always incorrect (despite addCleanup being docuemented to be run after tearDown).
History
Date User Action Args
2015-07-23 13:43:04neologixsetrecipients: + neologix
2015-07-23 13:43:04neologixsetmessageid: <1437658984.72.0.371299012028.issue24694@psf.upfronthosting.co.za>
2015-07-23 13:43:04neologixlinkissue24694 messages
2015-07-23 13:43:04neologixcreate