Message247196
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). |
|
Date |
User |
Action |
Args |
2015-07-23 13:43:04 | neologix | set | recipients:
+ neologix |
2015-07-23 13:43:04 | neologix | set | messageid: <1437658984.72.0.371299012028.issue24694@psf.upfronthosting.co.za> |
2015-07-23 13:43:04 | neologix | link | issue24694 messages |
2015-07-23 13:43:04 | neologix | create | |
|