summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2015-01-30 02:16:05 +0100
committerAndrew Bartlett <abartlet@samba.org>2015-03-06 04:41:49 +0100
commitb53a6df3d0587b7f865b425f66cee8361117b99f (patch)
tree7f915c1d0c8c48c9a5bb3c77f6a5bf83d47105fc
parent5d4a938c068a5838136e6f8f30b8c594bc5016f1 (diff)
downloadsamba-b53a6df3d0587b7f865b425f66cee8361117b99f.tar.gz
samba-b53a6df3d0587b7f865b425f66cee8361117b99f.tar.xz
samba-b53a6df3d0587b7f865b425f66cee8361117b99f.zip
Run cleanup after tearDown, for consistency with Python >= 2.7.
Change-Id: Ic3ce975e3b2e4b30e07643efb4496ebf36a93284 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--python/samba/tests/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index b73308ecd4..99cea490a1 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):