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
"""Samba Python tests."""
from __future__ import print_function
import os
"""Samba Python tests."""
from __future__ import print_function
import os
import tempfile
import warnings
import ldb
import tempfile
import warnings
import ldb
super(TestCaseInTempDir, self).setUp()
self.tempdir = tempfile.mkdtemp()
self.addCleanup(self._remove_tempdir)
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
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
self.tempdir = None
@contextmanager