summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2019-05-31 12:47:13 +1200
committerAndrew Bartlett <abartlet@samba.org>2019-06-07 21:08:12 +0000
commit56400153c8c7052fe319f273c30c6d59556102dc (patch)
treef9539b3b5fbb831e421b7aa4af8a08828396d92d /python
parentab376a97c972d2d5ebfb912ed90664c787860dc8 (diff)
downloadsamba-56400153c8c7052fe319f273c30c6d59556102dc.tar.gz
Revert TestCaseInSubDir parts of "downgradedatabase: blackbox test"
This reverts part of commit 74d15c9bf76f0a2fb5fa7b7b1d80971d10c4fe45. TestCaseInSubDir should not have been modified in this way, instead the downgradedatabase test should have removed the files it created specifically (this is part of the test, it shows the right files were created). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13978 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jun 7 21:08:12 UTC 2019 on sn-devel-184
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/__init__.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index 03c21c2bc88..cbd164de1f9 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -19,7 +19,6 @@
"""Samba Python tests."""
from __future__ import print_function
import os
-import shutil
import tempfile
import warnings
import ldb
@@ -295,15 +294,11 @@ class TestCaseInTempDir(TestCase):
super(TestCaseInTempDir, self).setUp()
self.tempdir = tempfile.mkdtemp()
self.addCleanup(self._remove_tempdir)
- self.check_tempdir_empty = True
def _remove_tempdir(self):
# Note asserting here is treated as an error rather than a test failure
- if self.check_tempdir_empty:
- self.assertEquals([], os.listdir(self.tempdir))
- os.rmdir(self.tempdir)
- else:
- shutil.rmtree(self.tempdir)
+ self.assertEquals([], os.listdir(self.tempdir))
+ os.rmdir(self.tempdir)
self.tempdir = None
@contextmanager