From b53a6df3d0587b7f865b425f66cee8361117b99f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Jan 2015 02:16:05 +0100 Subject: [PATCH] Run cleanup after tearDown, for consistency with Python >= 2.7. Change-Id: Ic3ce975e3b2e4b30e07643efb4496ebf36a93284 Signed-off-by: Jelmer Vernooij Reviewed-by: Andrew Bartlett --- 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 b73308ecd49..99cea490a1c 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.11.4.GIT