summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-10-26 15:58:06 -0800
committerJelmer Vernooij <jelmer@samba.org>2012-10-27 05:16:19 -0800
commit8d397b69bb29b7a464b610bc46cedd6be01b2455 (patch)
tree78866d85704bd412a92029a00a8a1f523003fcc1
parent67dd28f3605db4cbdc5feacc1121ec3d7dd075a6 (diff)
downloadsamba-8d397b69bb29b7a464b610bc46cedd6be01b2455.tar.gz
samba-8d397b69bb29b7a464b610bc46cedd6be01b2455.tar.bz2
samba-8d397b69bb29b7a464b610bc46cedd6be01b2455.zip
TestCaseInTempDir: Use addCleanup rather than tearDown.
-rw-r--r--source4/scripting/python/samba/tests/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index b13bcabbac..2df30a641b 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -76,11 +76,12 @@ class TestCaseInTempDir(TestCase):
def setUp(self):
super(TestCaseInTempDir, self).setUp()
self.tempdir = tempfile.mkdtemp()
+ self.addCleanup(self._remove_tempdir)
- def tearDown(self):
- super(TestCaseInTempDir, self).tearDown()
+ def _remove_tempdir(self):
self.assertEquals([], os.listdir(self.tempdir))
os.rmdir(self.tempdir)
+ self.tempdir = None
def env_loadparm():