[PATCH 50/55] Run cleanup after tearDown, for consistency with Python >= 2.7.

Jelmer Vernooij jelmer at samba.org
Fri Feb 6 12:04:22 MST 2015


Change-Id: Ic3ce975e3b2e4b30e07643efb4496ebf36a93284
Signed-off-by: Jelmer Vernooij <jelmer at samba.org>
---
 python/samba/tests/__init__.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index b73308e..99cea49 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -75,10 +75,11 @@ class TestCase(unittest.TestCase):
             self._cleanups = getattr(self, "_cleanups", []) + [
                 (fn, args, kwargs)]
 
-        def tearDown(self):
-            super(TestCase, self).tearDown()
+        def run(self, result=None):
+            ret = super(TestCase, self).run(result=result)
             for (fn, args, kwargs) in reversed(getattr(self, "_cleanups", [])):
                 fn(*args, **kwargs)
+            return ret
 
 
 class LdbTestCase(TestCase):
-- 
2.1.4



More information about the samba-technical mailing list